| | @@ -1782,10 +1782,11 @@ |
| 1782 | 1782 | /* Use win32_http_server() instead */ |
| 1783 | 1783 | fossil_exit(1); |
| 1784 | 1784 | #else |
| 1785 | 1785 | int listener = -1; /* The server socket */ |
| 1786 | 1786 | int connection; /* A socket for each individual connection */ |
| 1787 | + int nRequest = 0; /* Number of requests handled so far */ |
| 1787 | 1788 | fd_set readfds; /* Set of file descriptors for select() */ |
| 1788 | 1789 | socklen_t lenaddr; /* Length of the inaddr structure */ |
| 1789 | 1790 | int child; /* PID of the child process */ |
| 1790 | 1791 | int nchildren = 0; /* Number of child processes */ |
| 1791 | 1792 | struct timeval delay; /* How long to wait inside select() */ |
| | @@ -1869,11 +1870,14 @@ |
| 1869 | 1870 | lenaddr = sizeof(inaddr); |
| 1870 | 1871 | connection = accept(listener, (struct sockaddr*)&inaddr, &lenaddr); |
| 1871 | 1872 | if( connection>=0 ){ |
| 1872 | 1873 | child = fork(); |
| 1873 | 1874 | if( child!=0 ){ |
| 1874 | | - if( child>0 ) nchildren++; |
| 1875 | + if( child>0 ){ |
| 1876 | + nchildren++; |
| 1877 | + nRequest++; |
| 1878 | + } |
| 1875 | 1879 | close(connection); |
| 1876 | 1880 | }else{ |
| 1877 | 1881 | int nErr = 0, fd; |
| 1878 | 1882 | close(0); |
| 1879 | 1883 | fd = dup(connection); |
| | @@ -1886,10 +1890,11 @@ |
| 1886 | 1890 | fd = dup(connection); |
| 1887 | 1891 | if( fd!=2 ) nErr++; |
| 1888 | 1892 | } |
| 1889 | 1893 | close(connection); |
| 1890 | 1894 | g.nPendingRequest = nchildren+1; |
| 1895 | + g.nRequest = nRequest+1; |
| 1891 | 1896 | return nErr; |
| 1892 | 1897 | } |
| 1893 | 1898 | } |
| 1894 | 1899 | } |
| 1895 | 1900 | /* Bury dead children */ |
| 1896 | 1901 | |