httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_log_config.c
Date Sun, 08 Oct 2000 04:37:06 GMT
rbb         00/10/07 21:37:04

  Modified:    src      CHANGES
               src/modules/standard mod_log_config.c
  Log:
  Make mod_log_config compile cleanly when using BUFFERED_LOGS
  PR:	6519
  Submitted by:	Mike Abbott <mja@sgi.com>
  Reviewed by:	Ryan Bloom
  
  Revision  Changes    Path
  1.260     +3 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.259
  retrieving revision 1.260
  diff -u -r1.259 -r1.260
  --- CHANGES	2000/10/08 00:55:45	1.259
  +++ CHANGES	2000/10/08 04:37:02	1.260
  @@ -1,4 +1,7 @@
   Changes with Apache 2.0a7
  +  *) Fix mod_log_config so that it compiles cleanly with BUFFERED_LOGS
  +     [Mike Abbott <mja@sgi.com>]
  +
     *) Remove ap_send_fb.  This is no longer used in Apache, and it doesn't
        make much sense, because Apache uses buckets instead of BUFFs now.
        [Ryan Bloom]
  
  
  
  1.33      +28 -23    apache-2.0/src/modules/standard/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_log_config.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- mod_log_config.c	2000/08/06 06:07:47	1.32
  +++ mod_log_config.c	2000/10/08 04:37:04	1.33
  @@ -246,7 +246,7 @@
       apr_file_t *log_fd;
       char *condition_var;
   #ifdef BUFFERED_LOGS
  -    int outcnt;
  +    apr_ssize_t outcnt;
       char outbuf[LOG_BUFSIZE];
   #endif
   } config_log_state;
  @@ -756,7 +756,7 @@
   static void flush_log(config_log_state *cls)
   {
       if (cls->outcnt && cls->log_fd != NULL) {
  -        apr_write(cls->log_fd, cls->outbuf, cls->outcnt);
  +        apr_write(cls->log_fd, cls->outbuf, &cls->outcnt);
           cls->outcnt = 0;
       }
   }
  @@ -824,12 +824,15 @@
           flush_log(cls);
       }
       if (len >= LOG_BUFSIZE) {
  +        apr_ssize_t w;
  +
           str = apr_palloc(r->pool, len + 1);
           for (i = 0, s = str; i < format->nelts; ++i) {
               memcpy(s, strs[i], strl[i]);
               s += strl[i];
           }
  -        apr_write(cls->log_fd, str, len);
  +        w = len;
  +        apr_write(cls->log_fd, str, &w);
       }
       else {
           for (i = 0, s = &cls->outbuf[cls->outcnt]; i < format->nelts; ++i)
{
  @@ -1104,28 +1107,10 @@
       return NULL;
   }
   
  -static void init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, server_rec *s)
  -{
  -    /* First, do "physical" server, which gets default log fd and format
  -     * for the virtual servers, if they don't override...
  -     */
  -
  -    open_multi_logs(s, p);
  -
  -    /* Then, virtual servers */
  -
  -    for (s = s->next; s; s = s->next) {
  -        open_multi_logs(s, p);
  -    }
  -#ifdef BUFFERED_LOGS
  -	/* Now register the last buffer flush with the cleanup engine */
  -	apr_register_cleanup(p , s, flush_all_logs, flush_all_logs);
  -#endif
  -}
  -
   #ifdef BUFFERED_LOGS
  -static void flush_all_logs(server_rec *s)
  +static apr_status_t flush_all_logs(void *data)
   {
  +    server_rec *s = data;
       multi_log_state *mls;
       apr_array_header_t *log_list;
       config_log_state *clsarray;
  @@ -1147,8 +1132,28 @@
               }
           }
       }
  +    return APR_SUCCESS;
   }
   #endif
  +
  +static void init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, server_rec *s)
  +{
  +    /* First, do "physical" server, which gets default log fd and format
  +     * for the virtual servers, if they don't override...
  +     */
  +
  +    open_multi_logs(s, p);
  +
  +    /* Then, virtual servers */
  +
  +    for (s = s->next; s; s = s->next) {
  +        open_multi_logs(s, p);
  +    }
  +#ifdef BUFFERED_LOGS
  +	/* Now register the last buffer flush with the cleanup engine */
  +	apr_register_cleanup(p, s, flush_all_logs, flush_all_logs);
  +#endif
  +}
   
   static void register_hooks(void)
   {
  
  
  

Mime
View raw message