cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-02-07 Thread brian
brian   98/02/06 18:29:20

  Modified:src/main http_main.c http_protocol.c
  Log:
  Consensus on this list seemed to be that the "send lost connection"
  messages, while not a "debug"-level message, was also not a "warning"
  message, as frequently there's not much that a server administrator
  can do to mitigate those reports directly.  Swarms of lost connections
  may indicate connection troubles, but individual ones are not worth
  filling logfiles with.
  
  Revision  ChangesPath
  1.282 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.281
  retrieving revision 1.282
  diff -u -r1.281 -r1.282
  --- http_main.c   1998/02/06 17:59:29 1.281
  +++ http_main.c   1998/02/07 02:29:17 1.282
  @@ -841,7 +841,7 @@
   }
   
   if (!current_conn->keptalive)
  - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  + aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
current_conn->server, errstr);
   
   if (timeout_req) {
  
  
  
  1.186 +3 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.185
  retrieving revision 1.186
  diff -u -r1.185 -r1.186
  --- http_protocol.c   1998/02/04 21:23:33 1.185
  +++ http_protocol.c   1998/02/07 02:29:18 1.186
  @@ -1688,7 +1688,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
   "send body lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1777,7 +1777,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
   "send body lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1845,7 +1845,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
   "send mmap lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-02-09 Thread fielding
fielding98/02/08 16:45:59

  Modified:src/main http_main.c http_protocol.c
  Log:
  Reverse last change.  Vetoed because they are warnings and because
  APLOG_NOTICE is always logged regardless of log level.
  
  Revision  ChangesPath
  1.285 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.284
  retrieving revision 1.285
  diff -u -r1.284 -r1.285
  --- http_main.c   1998/02/08 18:16:01 1.284
  +++ http_main.c   1998/02/09 00:45:56 1.285
  @@ -845,7 +845,7 @@
   }
   
   if (!current_conn->keptalive)
  - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  + aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
current_conn->server, errstr);
   
   if (timeout_req) {
  
  
  
  1.187 +3 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.186
  retrieving revision 1.187
  diff -u -r1.186 -r1.187
  --- http_protocol.c   1998/02/07 02:29:18 1.186
  +++ http_protocol.c   1998/02/09 00:45:57 1.187
  @@ -1688,7 +1688,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
  +aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
   "send body lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1777,7 +1777,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
  +aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
   "send body lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1845,7 +1845,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_NOTICE, r->server,
  +aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
   "send mmap lost connection to %s",
   get_remote_host(r->connection,
   r->per_dir_config,
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-02-09 Thread fielding
fielding98/02/08 17:09:42

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  Improve the error_log message for "lost connection" so that
  clueless wankers won't automatically think the server is at fault.
  
  Revision  ChangesPath
  1.624 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.623
  retrieving revision 1.624
  diff -u -r1.623 -r1.624
  --- CHANGES   1998/02/08 20:50:57 1.623
  +++ CHANGES   1998/02/09 01:09:37 1.624
  @@ -186,6 +186,9 @@
 *) "File does not exist" error message was erroneously including the
errno.  [Marc Slemko]
   
  +  *) Improve the warning message generated when a client drops the
  + connection (hits stop button, etc.) during a send.  [Roy Fielding]
  +
 *) Defining GPROF will disable profiling in the parent and enable it
in the children.  If you're profiling under Linux this is pretty much
necessary because SIGPROF is lost across a fork(). [Dean Gaudet]
  
  
  
  1.286 +4 -3  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.285
  retrieving revision 1.286
  diff -u -r1.285 -r1.286
  --- http_main.c   1998/02/09 00:45:56 1.285
  +++ http_main.c   1998/02/09 01:09:39 1.286
  @@ -834,9 +834,10 @@
   else
dirconf = current_conn->server->lookup_defaults;
   if (sig == SIGPIPE) {
  - ap_snprintf(errstr, sizeof(errstr), "%s lost connection to %s",
  - timeout_name ? timeout_name : "request",
  - get_remote_host(current_conn, dirconf, REMOTE_NAME));
  + ap_snprintf(errstr, sizeof(errstr),
  + "%s client stopped connection before %s completed",
  + get_remote_host(current_conn, dirconf, REMOTE_NAME),
  + timeout_name ? timeout_name : "request");
   }
   else {
ap_snprintf(errstr, sizeof(errstr), "%s timed out for %s",
  
  
  
  1.188 +3 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- http_protocol.c   1998/02/09 00:45:57 1.187
  +++ http_protocol.c   1998/02/09 01:09:40 1.188
  @@ -1689,7 +1689,7 @@
   continue;
   else {
   aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  -"send body lost connection to %s",
  + "%s client stopped connection before send body 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
   REMOTE_NAME));
  @@ -1778,7 +1778,7 @@
   continue;
   else {
   aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  -"send body lost connection to %s",
  + "%s client stopped connection before send body 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
   REMOTE_NAME));
  @@ -1846,7 +1846,7 @@
   continue;
   else {
   aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  -"send mmap lost connection to %s",
  + "%s client stopped connection before send mmap 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
   REMOTE_NAME));
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-03-25 Thread pcs
pcs 98/03/25 02:07:57

  Modified:src/main http_main.c http_protocol.c
  Log:
  On Win32 it is not valid to check whether the socket descriptor is
  less than FD_SETSIZE.
  
  Also, in http_main.c check that listenmaxfd is not -1 (which would
  indicate that no sockets are available, and causes select() to fail
  rather badly, i.e. it does not set a valid errno). Instead we should exit.
  Add some more comments about how child/parent signalling works.
  
  Fixup a couple of incorrect calls to the child_exit_modules before
  child_init_modules had been called (this would only occur in a couple of
  rare error conditions).
  
  Revision  ChangesPath
  1.311 +35 -4 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.310
  retrieving revision 1.311
  diff -u -r1.310 -r1.311
  --- http_main.c   1998/03/25 02:57:23 1.310
  +++ http_main.c   1998/03/25 10:07:50 1.311
  @@ -2205,6 +2205,15 @@
   static int volatile generation;
   
   #ifdef WIN32
  +/*
  + * signal_parent() tells the parent process to wake up and do something.
  + * Once woken it will look at shutdown_pending and restart_pending to decide
  + * what to do. If neither variable is set, it will do a shutdown. This 
function
  + * if called by start_shutdown() or start_restart() in the parent's process
  + * space, so that the variables get set. However it can also be called 
  + * by child processes to force the parent to exit in an emergency.
  + */
  +
   static void signal_parent(void)
   {
   HANDLE e;
  @@ -2215,6 +2224,10 @@
* "apache-signal" event here.
*/
   
  +if (one_process) {
  + return;
  +}
  +
   APD1("*** SIGNAL_PARENT SET ***");
   
   e = OpenEvent(EVENT_ALL_ACCESS, FALSE, "apache-signal");
  @@ -2243,6 +2256,14 @@
* but we want to be able to start a shutdown/restart from other sources --
* e.g. on Win32, from the service manager. Now the service manager can
* call start_shutdown() or start_restart() as appropiate. 
  + *
  + * These should only be called from the parent process itself, since the
  + * parent process will use the shutdown_pending and restart_pending variables
  + * to determine whether to shutdown or restart. The child process should
  + * call signal_parent() directly to tell the parent to die -- this will
  + * cause neither of those variable to be set, which the parent will
  + * assume means something serious is wrong (which it will be, for the
  + * child to force an exit) and so do an exit anyway.
*/
   
   void start_shutdown(void)
  @@ -2698,6 +2719,7 @@
   #endif
   unblock_alarms();
   
  +#ifndef WIN32
   /* protect various fd_sets */
   if (s >= FD_SETSIZE) {
aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL,
  @@ -2708,6 +2730,8 @@
close(s);
return -1;
   }
  +#endif
  +
   return s;
   }
   
  @@ -4483,23 +4507,30 @@
aplog_error(APLOG_MARK,APLOG_ERR|APLOG_WIN32ERROR, server_conf,
"Waiting for start_mutex or exit_event -- process will exit");
   
  - child_exit_modules(pconf, server_conf);
destroy_pool(pchild);
  -
cleanup_scoreboard();
exit(0);
   }
   if (rv == WAIT_OBJECT_0 + 1) {
/* exit event signalled - exit now */
  - child_exit_modules(pconf, server_conf);
destroy_pool(pchild);
  -
cleanup_scoreboard();
exit(0);
   }
   /* start_mutex obtained, continue into the select() loop */
   
   setup_listeners(pconf);
  +if (listenmaxfd == -1) {
  + /* Help, no sockets were made, better log something and exit */
  + aplog_error(APLOG_MARK, APLOG_CRIT|APLOG_NOERRNO, NULL,
  + "No sockets were created for listening");
  +
  + signal_parent();/* tell parent to die */
  +
  + destroy_pool(pchild);
  + cleanup_scoreboard();
  + exit(0);
  +}
   set_signals();
   
   /*
  
  
  
  1.203 +2 -0  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.202
  retrieving revision 1.203
  diff -u -r1.202 -r1.203
  --- http_protocol.c   1998/03/25 02:57:26 1.202
  +++ http_protocol.c   1998/03/25 10:07:55 1.203
  @@ -1663,6 +1663,7 @@
   bsetflag(fb, B_RD, 0);
   bnonblock(fb, B_RD);
   fd = bfileno(fb, B_RD);
  +#ifndef WIN32
   if (fd >= FD_SETSIZE) {
aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL,
"send body: filedescriptor (%u) larger than FD_SETSIZE (%u) "
  @@ -1670,6 +1671,7 @@
"larger FD_SETSIZE", fd, FD_SETSIZE);
return 0;
   }
  +#endif
   
   soft_timeout("send body", r);
   
  
  
 

cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-04-05 Thread fielding
fielding98/04/05 16:16:11

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  Reduce logging level of "normal" warning messages to APLOG_INFO,
  since we are now logging APLOG_WARNING by default.
  
  Revision  ChangesPath
  1.757 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.756
  retrieving revision 1.757
  diff -u -r1.756 -r1.757
  --- CHANGES   1998/04/05 21:34:37 1.756
  +++ CHANGES   1998/04/05 23:16:08 1.757
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3b6
   
  +  *) Reduce logging level of "normal" warning messages to APLOG_INFO,
  + since we are now logging APLOG_WARNING by default. [Roy Fielding]
  +
 *) PORT: OS/2 tweak to deal with multiple .exe targets. [Brian Havard]

 *) Add documentation file and src/Configuration.tmpl entry for the
  
  
  
  1.319 +4 -4  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.318
  retrieving revision 1.319
  diff -u -r1.318 -r1.319
  --- http_main.c   1998/04/01 14:24:30 1.318
  +++ http_main.c   1998/04/05 23:16:09 1.319
  @@ -120,8 +120,8 @@
   /* Set this non-zero if you are prepared to put up with more than one log 
entry per second */
   #define SEVERELY_VERBOSE 0
   
  -  /* APD1() to APD5() are macros to help us debug. Then can either
  -   * log to the screen or the error_log file. In release builds, this
  +  /* APD1() to APD5() are macros to help us debug. They can either
  +   * log to the screen or the error_log file. In release builds, these
  * macros do nothing. In debug builds, they send messages at priority
  * "debug" to the error log file, or if DEBUG_TO_CONSOLE is defined,
  * to the console.
  @@ -839,14 +839,14 @@
dirconf = current_conn->server->lookup_defaults;
   if (!current_conn->keptalive) {
if (sig == SIGPIPE) {
  - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  + aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
current_conn->server,
"%s client stopped connection before %s completed",
get_remote_host(current_conn, dirconf, REMOTE_NAME),
timeout_name ? timeout_name : "request");
}
else {
  - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  + aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
current_conn->server,
"%s timed out for %s",
timeout_name ? timeout_name : "request",
  
  
  
  1.208 +3 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.207
  retrieving revision 1.208
  diff -u -r1.207 -r1.208
  --- http_protocol.c   1998/04/01 20:53:16 1.207
  +++ http_protocol.c   1998/04/05 23:16:10 1.208
  @@ -1627,7 +1627,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_INFO, r->server,
"%s client stopped connection before send body 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1725,7 +1725,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_INFO, r->server,
"%s client stopped connection before send body 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
  @@ -1793,7 +1793,7 @@
   else if (errno == EAGAIN)
   continue;
   else {
  -aplog_error(APLOG_MARK, APLOG_WARNING, r->server,
  +aplog_error(APLOG_MARK, APLOG_INFO, r->server,
"%s client stopped connection before send mmap 
completed",
   get_remote_host(r->connection,
   r->per_dir_config,
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-08-02 Thread fielding
fielding98/08/01 21:43:19

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  Allow ap_read_request errors to propagate through the normal request
  handling loop so that the connection can be properly closed with
  lingering_close, thus avoiding a potential TCP reset that would
  cause the client to miss the HTTP error response.
  
  Revision  ChangesPath
  1.993 +5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.992
  retrieving revision 1.993
  diff -u -r1.992 -r1.993
  --- CHANGES   1998/07/28 17:26:43 1.992
  +++ CHANGES   1998/08/02 04:43:15 1.993
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.2
   
  +  *) Allow ap_read_request errors to propagate through the normal request
  + handling loop so that the connection can be properly closed with
  + lingering_close, thus avoiding a potential TCP reset that would
  + cause the client to miss the HTTP error response.  [Roy Fielding]
  +
 *) One more portability fix for APACI shadow tree support: Swap order of 
awk
and sed in top-level configure script to avoid sed fails on some
platforms (for instance SunOS 4.1.3 and NCR SysV) because of the
  
  
  
  1.376 +14 -9 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.375
  retrieving revision 1.376
  diff -u -r1.375 -r1.376
  --- http_main.c   1998/07/20 16:37:11 1.375
  +++ http_main.c   1998/08/02 04:43:17 1.376
  @@ -3699,8 +3699,11 @@
   
(void) ap_update_child_status(my_child_num, SERVER_BUSY_WRITE, r);
   
  - ap_process_request(r);
  + /* process the request if it was read without error */
   
  + if (r->status == HTTP_OK)
  + ap_process_request(r);
  +
   #if defined(STATUS)
increment_counts(my_child_num, r);
   #endif
  @@ -4466,15 +4469,16 @@
conn = new_connection(ptrans, server_conf, cio,
  (struct sockaddr_in *) &sa_client,
  (struct sockaddr_in *) &sa_server, -1);
  - r = ap_read_request(conn);
  - if (r)
  - ap_process_request(r);  /* else premature EOF (ignore) */
   
  - while (r && conn->keepalive && !conn->aborted) {
  - ap_destroy_pool(r->pool);
  - r = ap_read_request(conn);
  - if (r)
  + while ((r = ap_read_request(conn)) != NULL) {
  +
  + if (r->status == HTTP_OK)
ap_process_request(r);
  +
  + if (!conn->keepalive || conn->aborted)
  + break;
  +
  + ap_destroy_pool(r->pool);
}
   
ap_bclose(cio);
  @@ -4779,7 +4783,8 @@
while ((r = ap_read_request(current_conn)) != NULL) {
(void) ap_update_child_status(child_num, SERVER_BUSY_WRITE, r);
   
  - ap_process_request(r);
  + if (r->status == HTTP_OK)
  + ap_process_request(r);
   
   #if defined(STATUS)
increment_counts(child_num, r);
  
  
  
  1.227 +2 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.226
  retrieving revision 1.227
  diff -u -r1.226 -r1.227
  --- http_protocol.c   1998/07/22 05:48:21 1.226
  +++ http_protocol.c   1998/08/02 04:43:18 1.227
  @@ -803,8 +803,8 @@
   ap_send_error_response(r, 0);
   ap_bflush(r->connection->client);
   ap_log_transaction(r);
  +return r;
   }
  -r->connection->aborted = 1;
   return NULL;
   }
   if (!r->assbackwards) {
  @@ -819,8 +819,7 @@
   ap_send_error_response(r, 0);
   ap_bflush(r->connection->client);
   ap_log_transaction(r);
  -r->connection->aborted = 1;
  -return NULL;
  +return r;
   }
   }
   else {
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1999-04-20 Thread dgaudet
dgaudet 99/04/20 12:15:46

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  r->request_time wasn't being set in certain error cases
  
  PR:   4156
  
  Revision  ChangesPath
  1.1313+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1312
  retrieving revision 1.1313
  diff -u -r1.1312 -r1.1313
  --- CHANGES   1999/04/20 18:36:01 1.1312
  +++ CHANGES   1999/04/20 19:15:34 1.1313
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) r->request_time wasn't being set properly in certain error conditions.
  + [Dean Gaudet] PR#4156
  +
 *) PORT: deal with UTS compiler error in http_protocol.c
[Dave Dykstra <[EMAIL PROTECTED]>] PR#4189
   
  
  
  
  1.430 +6 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.429
  retrieving revision 1.430
  diff -u -r1.429 -r1.430
  --- http_main.c   1999/04/08 21:04:43 1.429
  +++ http_main.c   1999/04/20 19:15:39 1.430
  @@ -1079,8 +1079,13 @@
log_req = log_req->prev;
}
   
  - if (!current_conn->keptalive)
  + if (!current_conn->keptalive) {
  + /* in some cases we come here before setting the time */
  + if (log_req->request_time == 0) {
  +   log_req->request_time = time(0);
  + }
ap_log_transaction(log_req);
  + }
   
ap_bsetflag(save_req->connection->client, B_EOUT, 1);
ap_bclose(save_req->connection->client);
  
  
  
  1.264 +4 -0  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.263
  retrieving revision 1.264
  diff -u -r1.263 -r1.264
  --- http_protocol.c   1999/04/20 18:36:07 1.263
  +++ http_protocol.c   1999/04/20 19:15:41 1.264
  @@ -791,6 +791,10 @@
   while ((len = getline(l, sizeof(l), conn->client, 0)) <= 0) {
   if ((len < 0) || ap_bgetflag(conn->client, B_EOF)) {
   ap_bsetflag(conn->client, B_SAFEREAD, 0);
  + /* this is a hack to make sure that request time is set,
  +  * it's not perfect, but it's better than nothing 
  +  */
  + r->request_time = time(0);
   return 0;
   }
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c util.c

1998-06-06 Thread dgaudet
dgaudet 98/06/06 12:30:53

  Modified:src  CHANGES Configure
   src/include conf.h
   src/main http_main.c http_protocol.c util.c
  Log:
  Updated support for UTS 2.1.2.
  
  PR:   2320
  Submitted by: Dave Dykstra <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.890 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.889
  retrieving revision 1.890
  diff -u -r1.889 -r1.890
  --- CHANGES   1998/06/06 19:21:20 1.889
  +++ CHANGES   1998/06/06 19:30:38 1.890
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) PORT: Updated support for UTS 2.1.2.
  + [Dave Dykstra <[EMAIL PROTECTED]>] PR#2320
  +
 *) Fix symbol export list (src/support/httpd.exp) after recent
API changes in the child spawning area.
[Jens-Uwe Mager <[EMAIL PROTECTED]>]
  
  
  
  1.263 +2 -1  apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /export/home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.262
  retrieving revision 1.263
  diff -u -r1.262 -r1.263
  --- Configure 1998/06/04 20:13:12 1.262
  +++ Configure 1998/06/06 19:30:39 1.263
  @@ -629,8 +629,9 @@
;;
   *-uts*)
OS='Amdahl UTS'
  - CFLAGS="$CFLAGS -Xa -eft -DUTS21"
  + CFLAGS="$CFLAGS -Xa -eft -DUTS21 -DUSEBCOPY"
LIBS="$LIBS -lsocket -lbsd -la"
  + DEF_WANTHSREGEX=yes
;;
   *-ultrix)
OS='ULTRIX'
  
  
  
  1.215 +12 -1 apache-1.3/src/include/conf.h
  
  Index: conf.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v
  retrieving revision 1.214
  retrieving revision 1.215
  diff -u -r1.214 -r1.215
  --- conf.h1998/06/04 20:13:17 1.214
  +++ conf.h1998/06/06 19:30:46 1.215
  @@ -573,13 +573,24 @@
   #undef NO_KILLPG
   #define NO_SETSID
   #define NEED_WAITPID
  -#define NO_OTHER_CHILD
   #define STDIN_FILENO 0
   #define STDOUT_FILENO 1
   #define STDERR_FILENO 2
   #define HAVE_SYSLOG 1
  +#define USE_LONGJMP
  +#define JMP_BUF jmp_buf
  +#define NO_USE_SIGACTION
  +#define NEED_STRERROR
  +#define NEED_STRSTR
  +#define NEED_HASHBANG_EMUL
  +#define NDELAY_PIPE_RETURNS_ZERO
  +#define NO_DATA NO_ADDRESS
  +#define  ap_wait_t   union wait
  +#define WEXITSTATUS(status)  (int)((status).w_retcode)
  +#define WTERMSIG(status) (int)((status).w_termsig)
   #define strftime(buf,bufsize,fmt,tm)ascftime(buf,fmt,tm)
   #include 
  +#include  
   
   #elif defined(APOLLO)
   #undef HAVE_GMTOFF
  
  
  
  1.359 +17 -15apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.358
  retrieving revision 1.359
  diff -u -r1.358 -r1.359
  --- http_main.c   1998/06/04 20:13:19 1.358
  +++ http_main.c   1998/06/06 19:30:47 1.359
  @@ -2129,29 +2129,26 @@
   }
   
   
  -#if defined(BROKEN_WAIT) || defined(NEED_WAITPID)
  +#if defined(NEED_WAITPID)
   /*
  -   Some systems appear to fail to deliver dead children to wait() at times.
  -   This sorts them out. In fact, this may have been caused by a race 
condition
  -   in wait_or_timeout(). But this routine is still useful for systems with no
  -   waitpid().
  +   Systems without a real waitpid sometimes lose a child's exit while waiting
  +   for another.  Search through the scoreboard for missing children.
*/
  -int reap_children(void)
  +int reap_children(ap_wait_t *status)
   {
  -int status, n;
  -int ret = 0;
  +int n, pid;
   
   for (n = 0; n < max_daemons_limit; ++n) {
  - if (ap_scoreboard_image->servers[n].status != SERVER_DEAD
  - && waitpid(ap_scoreboard_image->parent[n].pid, &status, WNOHANG)
  - == -1
  - && errno == ECHILD) {
  - ap_sync_scoreboard_image();
  +ap_sync_scoreboard_image();
  + if (ap_scoreboard_image->servers[n].status != SERVER_DEAD &&
  + kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
ap_update_child_status(n, SERVER_DEAD, NULL);
  - ret = 1;
  + /* just mark it as having a successful exit status */
  + *status = 0; 
  + return(pid);
}
   }
  -return ret;
  +return 0;
   }
   #endif
   
  @@ -2214,6 +2211,11 @@
   if (ret > 0) {
return ret;
   }
  +#ifdef NEED_WAITPID
  +if ((ret = reap_children(status)) > 0) {
  + return ret;
  +}
  +#endif
   tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 100;
   tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 100;
   ap_select(0, NULL, NULL, NULL, &tv);
  
  
  
  1.218