diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-04-04 09:33:44 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2025-04-04 09:33:44 +0000 |
| commit | 76dd97c06419565c830323f1a43c147eada5d98a (patch) | |
| tree | 37bb11a07a0e24a96dc77c790626a77a5bbc6156 /src | |
| parent | 68df4fe5094af1e75b2f7e2b25887ea8c857caaa (diff) | |
| download | tipidee-76dd97c06419565c830323f1a43c147eada5d98a.tar.gz | |
Better tarpit
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/tipideed/tipideed.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c index f0c6eac..c32cd2c 100644 --- a/src/tipideed/tipideed.c +++ b/src/tipideed/tipideed.c @@ -301,8 +301,7 @@ static inline int serve (tipidee_rql *rql, char const *docroot, char *uribuf, ti return respond_options(rql, 2 | !!(ra.flags & TIPIDEE_RA_FLAG_CGI)) ; tipidee_log_resource(g.logv, rql, fn, &ra, infopath) ; - - if (g.tarpit) sleep(g.tarpit / 1000) ; + if (g.tarpit) millisleep(g.tarpit) ; if (ra.flags & TIPIDEE_RA_FLAG_CGI) return respond_cgi(rql, docroot, fn, docrootlen, infopath, uribuf, hdr, &ra, body, bodylen) ; @@ -424,7 +423,7 @@ int main (int argc, char const *const *argv, char const *const *envp) tain_add_g(&deadline, &g.readtto) ; bodysa.len = 0 ; - if (g.tarpit) sleep(g.tarpit / 1000) ; + if (g.tarpit) millisleep(g.tarpit) ; e = tipidee_rql_read_g(buffer_0, uribuf, URI_BUFSIZE, 0, &rql, &deadline) ; switch (e) { |
