httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/proxy proxy_connect.c proxy_ftp.c proxy_http.c proxy_util.c
Date Tue, 13 Jun 2000 06:17:49 GMT
chuck       00/06/12 23:17:48

  Modified:    src/modules/file_cache cache_util.c file_cache.c
                        file_garbage.c mod_cache.h
               src/modules/proxy proxy_connect.c proxy_ftp.c proxy_http.c
                        proxy_util.c
  Log:
  fixups for remaining current warnings
  
  Submitted by:	Chuck Murcko
  
  Revision  Changes    Path
  1.2       +2 -4      apache-2.0/src/modules/file_cache/cache_util.c
  
  Index: cache_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/cache_util.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cache_util.c	2000/06/12 21:41:59	1.1
  +++ cache_util.c	2000/06/13 06:17:44	1.2
  @@ -64,7 +64,6 @@
   
   int file_cache_get_hdrs(cache_req *cq)
   {
  -    BUFF *fp;
       if(cq->state & FC_TEMP_FILE && !cq->hdrs)
           cq->hdrs = ap_make_table(cq->el.cache->pool, 20);
       return file_cache_read_hdrs(cq);
  @@ -193,7 +192,7 @@
      informatino will be read and written transparent to clients of this module */
   static int file_cache_read_mydata(BUFF *fp, cache_req *cq)
   {
  -     char urlbuff[1034], *strp;
  +    char urlbuff[1034];
       int len, offset=0;
   
       if(cq->state & FC_READ_MY_DATA || !cq->hdrsfile)
  @@ -352,7 +351,6 @@
           cq->expire = ap_parseHTTPdate(expire);
       if(!expire || cq->expire == BAD_DATE)
       {
  -        char buff[20];
           /* so we now have the expiry date */
           /* if no expiry date then
            *   if lastmod
  @@ -369,7 +367,7 @@
           else
               cq->expire = now + conf->defaultexpire;
           ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
  -                         "Expiry date calculated %ld", cq->expire);
  +                         "Expiry date calculated %ld", (long)(cq->expire));
       }
   
       ap_cache_msec2hex(cq->date, buff);
  
  
  
  1.2       +1 -1      apache-2.0/src/modules/file_cache/file_cache.c
  
  Index: file_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/file_cache.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- file_cache.c	2000/06/12 21:41:59	1.1
  +++ file_cache.c	2000/06/13 06:17:44	1.2
  @@ -105,7 +105,7 @@
           ap_status_t ret = APR_ENOENT;
           char *data = data_file(h, name);
           *el_in = NULL;
  -        if(fp = ap_bopenf(h->pool, data, APR_WRITE | APR_READ | APR_BINARY, 0))
  +        if((fp = ap_bopenf(h->pool, data, APR_WRITE | APR_READ | APR_BINARY, 0)))
           {
               cache_req *cq = create_cache_el(h, name);
               cq->fp = fp;
  
  
  
  1.2       +4 -4      apache-2.0/src/modules/file_cache/file_garbage.c
  
  Index: file_garbage.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/file_garbage.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- file_garbage.c	2000/06/12 21:41:59	1.1
  +++ file_garbage.c	2000/06/13 06:17:44	1.2
  @@ -124,8 +124,8 @@
   
       (void) pthread_mutex_lock(&garbage_mutex);
       if (inside == 1) {
  -    (void) pthread_mutex_unlock(&garbage_mutex);
  -    return;
  +        (void) pthread_mutex_unlock(&garbage_mutex);
  +        return APR_ENOLOCK;    /* @@@FIXME */
       }
       else
       inside = 1;
  @@ -226,7 +226,7 @@
   #ifndef NO_SETSID
               if ((pgrp = setsid()) == -1) {
               perror("setsid");
  -            ap_log_error(APLOG_MARK, 0, APLOG_STARTUP | APLOG_NOERRNO,  0, NULL, "%s: setsid
failed",
  +            ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO,  0, NULL, "%s: setsid
failed",
                        ap_server_argv0);
               exit(1);
               }
  @@ -363,7 +363,7 @@
           fent = &((struct gc_ent *) files->elts)[i];
           sprintf(filename, "%s%s%s", cachedir, fent->base, CACHE_HEADER_SUFFIX);
           ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
  -                     "GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, fent->expire,
garbage_now);
  +                     "GC Unlinking %s (expiry %ld, garbage_now %ld)", filename, (long)fent->expire,
(long)garbage_now);
   #if TESTING
           ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                        "Would unlink %s", filename);
  
  
  
  1.2       +20 -47    apache-2.0/src/modules/file_cache/mod_cache.h
  
  Index: mod_cache.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/file_cache/mod_cache.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_cache.h	2000/06/12 21:41:59	1.1
  +++ mod_cache.h	2000/06/13 06:17:45	1.2
  @@ -59,60 +59,21 @@
   #ifndef MOD_CACHE_H
   #define MOD_CACHE_H 
   
  -#include <sys/stat.h>
   #include "ap_cache.h"
   
  -/*
  - * Main include file for the Apache proxy
  - */
  -
  -/*
  -
  -   Note that the Explain() stuff is not yet complete.
  -   Also note numerous FIXMEs and CHECKMEs which should be eliminated.
  -
  -   If TESTING is set, then garbage collection doesn't delete ... probably a good
  -   idea when hacking.
  -
  -   This code is still experimental!
  -
  -   Things to do:
  -
  -   1. Make it garbage collect in the background, not while someone is waiting
  -      for a response!
  -
  -   2. Check the logic thoroughly.
  -
  -   3. Empty directories are only removed the next time round (but this does
  -      avoid two passes). Consider doing them the first time round.
  -
  -   Ben Laurie <ben@algroup.co.uk> 30 Mar 96
  -
  -   More things to do:
  -
  -   0. Code cleanup (ongoing)
  -
  -   1. add 230 response output for ftp now that it works
  -
  -   2. Make the ftp proxy transparent, also same with (future) gopher & wais
  -
  -   3. Use protocol handler struct a la Apache module handlers (Dirk van Gulik)
  -
  -   4. Use a cache expiry database for more efficient GC (Jeremy Wohl)
  -
  -   5. Bulletproof GC against SIGALRM
  -
  -   Chuck Murcko <chuck@topsail.org> 15 April 1997
  -
  - */
  -
  -#define TESTING 0
  -
   #include "httpd.h"
   #include "http_config.h"
   #include "http_protocol.h"
   #include "util_date.h"
   
  +#ifdef HAVE_UNISTD_H
  +#include <unistd.h>
  +#endif
  +
  +#include <sys/stat.h>
  +
  +#define TESTING 0
  +
   extern module MODULE_VAR_EXPORT cache_module;
   
   /* number of characters in the hash */
  @@ -172,6 +133,16 @@
       BUFF *fp;                /* the cache file descriptors */
   } cache_req;
   
  +/* in mod_cache.c */
  +ap_status_t file_cache_close(ap_cache_handle_t *h);
  +ap_status_t file_cache_el_hdr_walk(ap_cache_el *el,
  +         int (*comp)(void *, const char *, const char *),
  +         void *rec, va_list args);
  +ap_status_t file_cache_el_hdr(ap_cache_el *el, const char *name,
  +         const char *val, ap_cache_query flag);
  +ap_status_t file_cache_el_data(ap_cache_el *el, BUFF **b);
  +ap_status_t file_cache_reset(ap_cache_el *el, ap_cache_part f);
  +
   /* in file_garbage.c */
   ap_status_t file_cache_gc(ap_cache_handle_t *r);
   
  @@ -187,5 +158,7 @@
   char *data_file(ap_cache_handle_t *h, const char *name); /* generate datafile */
   int file_cache_get_data(cache_req *el); /* prepare el's fp */
   int mkdir_structure(char *file, const char *root);
  +ap_time_t ap_cache_hex2msec(const char *x);
  +void ap_cache_msec2hex(ap_time_t j, char *y);
   
   #endif
  
  
  
  1.6       +3 -3      apache-2.0/src/modules/proxy/proxy_connect.c
  
  Index: proxy_connect.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_connect.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- proxy_connect.c	2000/06/12 21:41:58	1.5
  +++ proxy_connect.c	2000/06/13 06:17:47	1.6
  @@ -115,15 +115,15 @@
                 const char *proxyhost, int proxyport)
   {
       struct in_addr destaddr;
  -    const char *host, *err;
  +    const char *host;
       char *p;
       int port;
       ap_socket_t *sock;
       char buffer[HUGE_STRING_LEN];
  -    int nbytes, i, j;
  +    int nbytes, i;
   
       BUFF *sock_buff;
  -    ap_socket_t *client_sock;
  +    ap_socket_t *client_sock=NULL;
       ap_pollfd_t *pollfd;
       ap_int32_t pollcnt;
       ap_int16_t pollevent;
  
  
  
  1.11      +1 -4      apache-2.0/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- proxy_ftp.c	2000/06/12 22:13:08	1.10
  +++ proxy_ftp.c	2000/06/13 06:17:47	1.11
  @@ -460,12 +460,11 @@
    */
   int ap_proxy_ftp_handler(request_rec *r, ap_cache_el  *c, char *url)
   {
  -    char *host, *path, *strp, *parms, *server_addr;
  +    char *host, *path, *strp, *parms;
       char *cwd = NULL;
       char *user = NULL;
   /*    char *account = NULL; how to supply an account in a URL? */
       const char *password = NULL;
  -    const char *err;
       ap_socket_t *sock, *dsock, *inc;
       int port, i, j, len, rc, nocache = 0;
       ap_socket_t *csd;
  @@ -485,9 +484,7 @@
   
   /* stuff for PASV mode */
       unsigned int presult, h0, h1, h2, h3, p0, p1;
  -    unsigned int paddr;
       unsigned short pport;
  -    struct sockaddr_in data_addr;
       int pasvmode = 0;
       char pasv[64];
       char *pstr, dates[AP_RFC822_DATE_LEN];
  
  
  
  1.10      +5 -5      apache-2.0/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- proxy_http.c	2000/06/13 01:22:09	1.9
  +++ proxy_http.c	2000/06/13 06:17:47	1.10
  @@ -172,15 +172,14 @@
   {
       const char *strp;
       char *strp2;
  -    const char *err, *desthost;
  +    const char *desthost;
       ap_socket_t *sock;
  -    int i, j, len, backasswards, content_length=-1;
  +    int i, len, backasswards, content_length=-1;
       ap_array_header_t *reqhdrs_arr;
  -    ap_table_t *resp_hdrs;
  +    ap_table_t *resp_hdrs=NULL;
       ap_table_entry_t *reqhdrs;
       struct sockaddr_in server;
       struct in_addr destaddr;
  -    struct hostent server_hp;
       BUFF *f, *cachefp=NULL;
       char buffer[HUGE_STRING_LEN];
       char portstr[32];
  @@ -456,7 +455,8 @@
           ap_bwrite(r->connection->client, buffer, len, &cntr);
           if (cachefp && ap_bwrite(cachefp, buffer, len, &cntr) != len) {
               ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  -                          "proxy: error writing extra data to cache");
  +                          "proxy: error writing extra data to cache %ld",
  +                          (long)cachefp);
               ap_proxy_cache_error(&c);
           }
       }
  
  
  
  1.15      +1 -2      apache-2.0/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- proxy_util.c	2000/06/12 21:41:58	1.14
  +++ proxy_util.c	2000/06/13 06:17:47	1.15
  @@ -496,9 +496,8 @@
       int  ok;
       char buf[IOBUFSIZE];
       long total_bytes_rcvd, in_buffer;
  -    proxy_server_conf *conf = (proxy_server_conf *) ap_get_module_config(r->server->module_config,
&proxy_module);
       ap_ssize_t cntr;
  -    register int n, o, w;
  +    register int n, o;
       conn_rec *con = r->connection;
       int alternate_timeouts = 1;    /* 1 if we alternate between soft & hard timeouts
*/
       BUFF *cachefp = NULL;
  
  
  

Mime
View raw message