add more cgi logging

Sun, 02 Jun 2024 16:36:02 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 02 Jun 2024 16:36:02 +0200
changeset 534
bf62eddbdb9b
parent 533
2d6099ba2a7c
child 535
bf07abfe7f0a

add more cgi logging

src/server/safs/cgi.c file | annotate | diff | comparison | revisions
src/server/safs/cgi.h file | annotate | diff | comparison | revisions
--- a/src/server/safs/cgi.c	Sun Jun 02 16:32:39 2024 +0200
+++ b/src/server/safs/cgi.c	Sun Jun 02 16:36:02 2024 +0200
@@ -325,7 +325,7 @@
     
     event->finish = cgi_event_finish;
     handler->writeev->finish = NULL;
-    CgiIOResult ret = cgi_read_output(handler, ev);
+    CgiIOResult ret = cgi_read_output(handler, ev, "readevent");
     switch(ret) {
         case CGI_IO_COMPLETE: {
             break;
@@ -364,7 +364,7 @@
     
     event->finish = cgi_event_finish;
     handler->readev->finish = NULL;
-    CgiIOResult ret = cgi_read_output(handler, ev);
+    CgiIOResult ret = cgi_read_output(handler, ev, "writeevent");
     switch(ret) {
         case CGI_IO_COMPLETE: {
             break;
@@ -386,7 +386,7 @@
 
 
 
-CgiIOResult cgi_read_output(CGIHandler *handler, EventHandler *ev) {
+CgiIOResult cgi_read_output(CGIHandler *handler, EventHandler *ev, const char *debug_log) {
     CGIResponseParser *parser = handler->parser;
     Session *sn = parser->sn;
     Request *rq = parser->rq;
@@ -473,6 +473,7 @@
         return CGI_IO_NEED_READ;
     }
     handler->cgi_eof = TRUE; 
+    log_ereport(LOG_DEBUG, "cgi-send: rq: %p pid: %d set cgi_eof : %s", rq, handler->process.pid, debug_log);
     return ret;
 }
 
@@ -583,6 +584,7 @@
     
     handler->debug_finished = TRUE;
     if(event->fn != cgi_stderr_readevent) {
+        log_ereport(LOG_DEBUG, "cgi-send: req: %p finish set cgi_eof: %s", rq, event_fn);
         handler->cgi_eof = TRUE;
     }
     
--- a/src/server/safs/cgi.h	Sun Jun 02 16:32:39 2024 +0200
+++ b/src/server/safs/cgi.h	Sun Jun 02 16:36:02 2024 +0200
@@ -171,7 +171,7 @@
 int cgi_event_finish(EventHandler *ev, Event *event);
 int cgi_writeevent(EventHandler *ev, Event *event);
 
-CgiIOResult cgi_read_output(CGIHandler *handler, EventHandler *ev);
+CgiIOResult cgi_read_output(CGIHandler *handler, EventHandler *ev, const char *debug_log);
 
 CGIResponseParser* cgi_parser_new(Session *sn, Request *rq);
 void cgi_parser_free(CGIResponseParser *parser);

mercurial