cvs commit: apache/src http_log.c

1997-06-29 Thread Ben Laurie
ben 97/06/29 08:25:22

  Modified:src   http_log.c
  Log:
  Make assert() exit.
  Submitted by: Marc Slemko
  
  Revision  ChangesPath
  1.17  +1 -0  apache/src/http_log.c
  
  Index: http_log.c
  ===
  RCS file: /export/home/cvs/apache/src/http_log.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -C3 -r1.16 -r1.17
  *** http_log.c1997/06/29 00:05:12 1.16
  --- http_log.c1997/06/29 15:25:21 1.17
  ***
  *** 213,216 
  --- 213,217 
ap_snprintf(buf, sizeof(buf), 
"line %d, assertion \"%s\" failed",nLine,szExp);
log_unixerr("assert",szFile,buf,NULL);
  + exit(1);
}
  
  
  


cvs commit: apache/src http_log.c

1997-06-28 Thread Marc Slemko
marc97/06/28 17:05:13

  Modified:src   http_log.c
  Log:
  We have ap_snprintf; use it.
  
  Revision  ChangesPath
  1.16  +6 -4  apache/src/http_log.c
  
  Index: http_log.c
  ===
  RCS file: /export/home/cvs/apache/src/http_log.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -C3 -r1.15 -r1.16
  *** http_log.c1997/06/28 22:39:21 1.15
  --- http_log.c1997/06/29 00:05:12 1.16
  ***
  *** 196,202 
fflush(s->error_log);
}

  ! void log_reason(const char *reason, const char *file, request_rec *r) {
fprintf (r->server->error_log,
 "[%s] access to %s failed for %s, reason: %s\n",
 get_time(), file,
  --- 196,203 
fflush(s->error_log);
}

  ! void log_reason(const char *reason, const char *file, request_rec *r) 
  ! {
fprintf (r->server->error_log,
 "[%s] access to %s failed for %s, reason: %s\n",
 get_time(), file,
  ***
  *** 206,214 
}

void log_assert(const char *szExp,const char *szFile,int nLine)
  ! {
char buf[1000];

  ! sprintf(buf,"line %d, assertion \"%s\" failed",nLine,szExp);
log_unixerr("assert",szFile,buf,NULL);
  ! }
  --- 207,216 
}

void log_assert(const char *szExp,const char *szFile,int nLine)
  ! {
char buf[1000];

  ! ap_snprintf(buf, sizeof(buf), 
  ! "line %d, assertion \"%s\" failed",nLine,szExp);
log_unixerr("assert",szFile,buf,NULL);
  ! }
  
  
  


cvs commit: apache/src http_log.c

1996-09-23 Thread Jim Jagielski
jim 96/09/23 07:07:10

  Modified:src   http_log.c
  Log:
  ErrorLog pipe fix
  
  Revision  ChangesPath
  1.7   +5 -3  apache/src/http_log.c
  
  Index: http_log.c
  ===
  RCS file: /export/home/cvs/apache/src/http_log.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -C3 -r1.6 -r1.7
  *** http_log.c1996/08/20 11:50:45 1.6
  --- http_log.c1996/09/23 14:07:09 1.7
  ***
  *** 50,56 
 *
 */

  ! /* $Id: http_log.c,v 1.6 1996/08/20 11:50:45 paul Exp $ */

/*
 * http_log.c: Dealing with the logs and errors
  --- 50,56 
 *
 */

  ! /* $Id: http_log.c,v 1.7 1996/09/23 14:07:09 jim Exp $ */

/*
 * http_log.c: Dealing with the logs and errors
  ***
  *** 86,101 
  
fname = server_root_relative (p, s->error_fname);

  ! if (*fname == '|') {
  FILE *dummy;

  !   spawn_child(p, error_log_child, (void *)(fname+1),
kill_after_timeout, &dummy, NULL);

if (dummy == NULL) {
fprintf (stderr, "Couldn't fork child for ErrorLog process\n");
exit (1);
  }
} else {
if(!(s->error_log = pfopen(p, fname, "a"))) {
fprintf(stderr,"httpd: could not open error log file %s.\n", 
fname);
  --- 86,103 
  
fname = server_root_relative (p, s->error_fname);

  ! if (*s->error_fname == '|') {
  FILE *dummy;

  !   spawn_child(p, error_log_child, (void *)(s->error_fname+1),
kill_after_timeout, &dummy, NULL);

if (dummy == NULL) {
fprintf (stderr, "Couldn't fork child for ErrorLog process\n");
exit (1);
  }
  + 
  +   s->error_log = dummy;
} else {
if(!(s->error_log = pfopen(p, fname, "a"))) {
fprintf(stderr,"httpd: could not open error log file %s.\n", 
fname);
  
  
  


cvs commit: apache/src http_log.c

1996-06-30 Thread Brian Behlendorf
brian   96/06/30 14:48:04

  Modified:src   http_log.c
  Log:
  Reviewed by:  Brian Behlendorf
  Submitted by: Howard Fear <[EMAIL PROTECTED]>
  
  Flushes the output, important in error recovery.
  
  Revision  ChangesPath
  1.5   +1 -0  apache/src/http_log.c
  
  Index: http_log.c
  ===
  RCS file: /export/home/cvs/apache/src/http_log.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -C3 -r1.4 -r1.5
  *** http_log.c1996/04/15 11:34:52 1.4
  --- http_log.c1996/06/30 21:48:02 1.5
  ***
  *** 179,184 
  --- 179,185 
va_end (args);

fputc('\n', s->error_log);
  + fflush(s->error_log);
}

void log_reason(char *reason, char *file, request_rec *r) {
  
  
  


cvs commit: apache/src http_log.c

1996-04-15 Thread Mark Cox
mjc 96/04/15 04:34:53

  Modified:src   http_log.c
  Log:
  Submitted by: James H. Cloos Jr. <[EMAIL PROTECTED]>
  
  Allow ErrorLogs to be pipes.
  
  Revision  ChangesPath
  1.4   +30 -4 apache/src/http_log.c
  
  Index: http_log.c
  ===
  RCS file: /export/home/cvs/apache/src/http_log.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -C3 -r1.3 -r1.4
  *** http_log.c1996/03/01 02:39:49 1.3
  --- http_log.c1996/04/15 11:34:52 1.4
  ***
  *** 67,81 

#include 

void open_error_log(server_rec *s, pool *p)
{
char *fname;
  
fname = server_root_relative (p, s->error_fname);
  ! if(!(s->error_log = pfopen(p, fname, "a"))) {
  ! fprintf(stderr,"httpd: could not open error log file %s.\n", fname);
  ! perror("fopen");
  ! exit(1);
}
}

  --- 67,107 

#include 

  + void error_log_child (void *cmd)
  + {
  + /* Child process code for 'ErrorLog "|..."';
  +  * may want a common framework for this, since I expect it will
  +  * be common for other foo-loggers to want this sort of thing...
  +  */
  + 
  + cleanup_for_exec();
  + signal (SIGHUP, SIG_IGN);
  + execl (SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL);
  + exit (1);
  + }
  + 
void open_error_log(server_rec *s, pool *p)
{
char *fname;
  
fname = server_root_relative (p, s->error_fname);
  ! 
  ! if (*fname == '|') {
  !   FILE *dummy;
  ! 
  !   spawn_child(p, error_log_child, (void *)(fname+1),
  ! kill_after_timeout, &dummy, NULL);
  ! 
  ! if (dummy == NULL) {
  ! fprintf (stderr, "Couldn't fork child for ErrorLog process\n");
  ! exit (1);
  !   }
  ! } else {
  ! if(!(s->error_log = pfopen(p, fname, "a"))) {
  ! fprintf(stderr,"httpd: could not open error log file %s.\n", 
fname);
  ! perror("fopen");
  ! exit(1);
  !   }
}
}