Fossil SCM
Add a new explanatory comment to clarify the operation of the "fossil server" implementation. No code changes.
Commit
c546212f10cc660669c4c795036b58221a3620c32450e7d75385e875dec05df5
Parent
e3258f1b4369ffd…
1 file changed
+9
+9
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2639,10 +2639,19 @@ | ||
| 2639 | 2639 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2640 | 2640 | db_close(1); |
| 2641 | 2641 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2642 | 2642 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2643 | 2643 | } |
| 2644 | + /* For the parent process, the cgi_http_server() command above never | |
| 2645 | + ** returns (except in the case of an error). Instead, for each incoming | |
| 2646 | + ** client connection, a child process is created, file descriptors 0 | |
| 2647 | + ** and 1 are bound to that connection, and the child returns. | |
| 2648 | + ** | |
| 2649 | + ** So, when control reaches this point, we are running as a | |
| 2650 | + ** child process, the HTTP or SCGI request is pending on file | |
| 2651 | + ** descriptor 0 and the reply should be written to file descriptor 1. | |
| 2652 | + */ | |
| 2644 | 2653 | if( zMaxLatency ){ |
| 2645 | 2654 | signal(SIGALRM, sigalrm_handler); |
| 2646 | 2655 | alarm(atoi(zMaxLatency)); |
| 2647 | 2656 | } |
| 2648 | 2657 | g.httpIn = stdin; |
| 2649 | 2658 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2639,10 +2639,19 @@ | |
| 2639 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2640 | db_close(1); |
| 2641 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2642 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2643 | } |
| 2644 | if( zMaxLatency ){ |
| 2645 | signal(SIGALRM, sigalrm_handler); |
| 2646 | alarm(atoi(zMaxLatency)); |
| 2647 | } |
| 2648 | g.httpIn = stdin; |
| 2649 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2639,10 +2639,19 @@ | |
| 2639 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2640 | db_close(1); |
| 2641 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2642 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2643 | } |
| 2644 | /* For the parent process, the cgi_http_server() command above never |
| 2645 | ** returns (except in the case of an error). Instead, for each incoming |
| 2646 | ** client connection, a child process is created, file descriptors 0 |
| 2647 | ** and 1 are bound to that connection, and the child returns. |
| 2648 | ** |
| 2649 | ** So, when control reaches this point, we are running as a |
| 2650 | ** child process, the HTTP or SCGI request is pending on file |
| 2651 | ** descriptor 0 and the reply should be written to file descriptor 1. |
| 2652 | */ |
| 2653 | if( zMaxLatency ){ |
| 2654 | signal(SIGALRM, sigalrm_handler); |
| 2655 | alarm(atoi(zMaxLatency)); |
| 2656 | } |
| 2657 | g.httpIn = stdin; |
| 2658 |