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.

34 lines
1.2 KiB

  1. From ab85841b142c62c47f69fc45c0b54f080d54ddc9 Mon Sep 17 00:00:00 2001
  2. From: Glenn Strauss <gstrauss@gluelogic.com>
  3. Date: Mon, 20 Feb 2017 14:47:13 -0500
  4. Subject: [PATCH] [mod_cgi] fix CGI local-redir w/ url.rewrite-once (fixes
  5. #2793)
  6. x-ref:
  7. "1.4.40 regression: broken redirect (using Location) between url.rewrite-once URLs"
  8. https://redmine.lighttpd.net/issues/2793
  9. ---
  10. src/mod_cgi.c | 5 ++---
  11. 1 file changed, 2 insertions(+), 3 deletions(-)
  12. --- a/src/mod_cgi.c
  13. +++ b/src/mod_cgi.c
  14. @@ -583,8 +583,7 @@ static int cgi_demux_response(server *sr
  15. }
  16. connection_response_reset(srv, con); /*(includes con->http_status = 0)*/
  17. -
  18. - con->mode = DIRECT;
  19. + plugins_call_connection_reset(srv, con);
  20. return FDEVENT_HANDLED_COMEBACK;
  21. }
  22. }
  23. @@ -803,7 +802,7 @@ static int cgi_recv_response(server *srv
  24. /* if we get a IN|HUP and have read everything don't exec the close twice */
  25. return HANDLER_FINISHED;
  26. case FDEVENT_HANDLED_COMEBACK:
  27. - cgi_connection_close(srv, hctx);
  28. + /*cgi_connection_close(srv, hctx);*//*(already cleaned up and hctx is now invalid)*/
  29. return HANDLER_COMEBACK;
  30. case FDEVENT_HANDLED_ERROR:
  31. log_error_write(srv, __FILE__, __LINE__, "s", "demuxer failed: ");