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.

32 lines
1.1 KiB

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