You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

  1. From fc566b541e4c67cfbd8d6b40b627ce27dfc8a7cb Mon Sep 17 00:00:00 2001
  2. From: Thierry FOURNIER <tfournier@exceliance.fr>
  3. Date: Fri, 22 Aug 2014 06:55:26 +0200
  4. Subject: [PATCH 5/6] BUG/MEDIUM: http: tarpit timeout is reset
  5. Before the commit bbba2a8ecc35daf99317aaff7015c1931779c33b
  6. (1.5-dev24-8), the tarpit section set timeout and return, after this
  7. commit, the tarpit section set the timeout, and go to the "done" label
  8. which reset the timeout.
  9. Thanks Bryan Talbot for the bug report and analysis.
  10. This should be backported in 1.5.
  11. (cherry picked from commit 7566e30477bf5ea4206bda5950d2d83108c4a3dc)
  12. ---
  13. src/proto_http.c | 5 +++--
  14. 1 file changed, 3 insertions(+), 2 deletions(-)
  15. diff --git a/src/proto_http.c b/src/proto_http.c
  16. index 2b75b32..bebc8bf 100644
  17. --- a/src/proto_http.c
  18. +++ b/src/proto_http.c
  19. @@ -4117,8 +4117,9 @@ int http_process_req_common(struct session *s, struct channel *req, int an_bit,
  20. done: /* done with this analyser, continue with next ones that the calling
  21. * points will have set, if any.
  22. */
  23. - req->analysers &= ~an_bit;
  24. req->analyse_exp = TICK_ETERNITY;
  25. + done_without_exp: /* done with this analyser, but dont reset the analyse_exp. */
  26. + req->analysers &= ~an_bit;
  27. return 1;
  28. tarpit:
  29. @@ -4144,7 +4145,7 @@ int http_process_req_common(struct session *s, struct channel *req, int an_bit,
  30. s->be->be_counters.denied_req++;
  31. if (s->listener->counters)
  32. s->listener->counters->denied_req++;
  33. - goto done;
  34. + goto done_without_exp;
  35. deny: /* this request was blocked (denied) */
  36. txn->flags |= TX_CLDENY;
  37. --
  38. 1.8.5.5