httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgau...@hyperreal.org
Subject cvs commit: apache-1.3/src/main http_log.c
Date Tue, 22 Sep 1998 15:43:43 GMT
dgaudet     98/09/22 08:43:43

  Modified:    src/main http_log.c
  Log:
  ap_table_set() causes an ap_pstrdup() of both arguments, one of the
  arguments is a constant and it's a waste to pstrdup it.  Furthermore using
  a static local buffer means there is a static limit to the message length.
  Also, ap_pvsprintf() can get away with zero-copies of the output in most
  cases, whereas ap_pstrdup() always copies the output at least once.
  Unlike Ken's claim there's no "gyration" required by ap_pv?sprintf()
  to figure out the string length.  Clean this all up.
  
  Revision  Changes    Path
  1.69      +2 -4      apache-1.3/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_log.c,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- http_log.c	1998/09/21 17:29:45	1.68
  +++ http_log.c	1998/09/22 15:43:42	1.69
  @@ -441,10 +441,8 @@
       va_start(args, fmt);
       log_error_core(file, line, level, r->server, r, fmt, args);
       if (ap_table_get(r->notes, "error-notes") == NULL) {
  -	char errstr[MAX_STRING_LEN];
  -
  -	ap_vsnprintf(errstr, sizeof(errstr), fmt, args);
  -	ap_table_set(r->notes, "error-notes", errstr);
  +	ap_table_setn(r->notes, "error-notes",
  +	    ap_pvsprintf(r->pool, fmt, args));
       }
       va_end(args);
   }
  
  
  

Mime
View raw message