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/proxy mod_proxy.h proxy_ftp.c proxy_http.c proxy_util.c
Date Sat, 11 Nov 2000 18:34:10 GMT
rbb         00/11/11 10:34:10

  Modified:    src/modules/proxy mod_proxy.h proxy_ftp.c proxy_http.c
                        proxy_util.c
  Log:
  The whole proxy compiles cleanly now.  Now we need to make it actually work
  again, but at least we are making progress.
  
  Revision  Changes    Path
  1.17      +1 -1      apache-2.0/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_proxy.h	2000/11/11 18:13:04	1.16
  +++ mod_proxy.h	2000/11/11 18:34:09	1.17
  @@ -256,7 +256,7 @@
   			 char **passwordp, char **hostp, int *port);
   const char *ap_proxy_date_canon(apr_pool_t *p, const char *x);
   apr_table_t *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF *f);
  -long int ap_proxy_send_fb(proxy_completion *, BUFF *f, request_rec *r, ap_cache_el *c);
  +long int ap_proxy_send_fb(proxy_completion *, apr_socket_t *f, request_rec *r, ap_cache_el
*c);
   void ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *hdrs);
   int ap_proxy_liststr(const char *list, const char *val);
   void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength);
  
  
  
  1.21      +1 -1      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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- proxy_ftp.c	2000/11/11 18:13:04	1.20
  +++ proxy_ftp.c	2000/11/11 18:34:10	1.21
  @@ -1205,7 +1205,7 @@
   /* send body */
       if (!r->header_only) {
   	if (parms[0] != 'd') {
  -	    ap_proxy_send_fb(NULL, data, r, c);
  +	    ap_proxy_send_fb(NULL, dsock, r, c);
   	} else
   	    send_dir(data, r, c, cwd);
   
  
  
  
  1.19      +1 -1      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- proxy_http.c	2000/11/11 18:13:04	1.18
  +++ proxy_http.c	2000/11/11 18:34:10	1.19
  @@ -487,7 +487,7 @@
   		proxy_completion pc;
   		pc.content_length = content_length;
   		pc.cache_completion = conf->cache_completion;
  -		ap_proxy_send_fb(&pc, f, r, c);
  +		ap_proxy_send_fb(&pc, sock, r, c);
       }
   
       ap_bclose(f);
  
  
  
  1.24      +30 -14    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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- proxy_util.c	2000/11/11 18:13:04	1.23
  +++ proxy_util.c	2000/11/11 18:34:10	1.24
  @@ -490,7 +490,7 @@
       return resp_hdrs;
   }
   
  -long int ap_proxy_send_fb(proxy_completion *completion, BUFF *f, request_rec *r, ap_cache_el
*c)
  +long int ap_proxy_send_fb(proxy_completion *completion, apr_socket_t *f, request_rec *r,
ap_cache_el *c)
   {
       int  ok;
       char buf[IOBUFSIZE];
  @@ -505,6 +505,7 @@
       total_bytes_rcvd = 0;
       if (c) ap_cache_el_data(c, &cachefp);
   
  +#if 0
   #ifdef CHARSET_EBCDIC
       /* The cache copy is ASCII, not EBCDIC, even for text/html) */
       ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0);
  @@ -512,6 +513,7 @@
   		ap_bsetflag(c->fp, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0);
       ap_bsetflag(con->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0);
   #endif
  +#endif
   
       /* Since we are reading from one buffer and writing to another,
        * it is unsafe to do a soft_timeout here, at least until the proxy
  @@ -542,7 +544,8 @@
        */
       for (ok = 1; ok; cntr = 0) {
   	/* Read block from server */
  -	if (ap_bread(f, buf, IOBUFSIZE, &cntr) != APR_SUCCESS && !cntr)
  +        cntr = IOBUFSIZE;
  +	if (apr_recv(f, buf, &cntr) != APR_SUCCESS && !cntr)
           {
               if (c != NULL) {
                   ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  @@ -570,7 +573,8 @@
   
   	/* Write the block to the client, detect aborted transfers */
           while (!con->aborted && in_buffer > 0) {
  -            if (ap_bwrite(con->client, &buf[o], in_buffer, &cntr) != APR_SUCCESS)
{
  +            cntr = in_buffer;
  +            if (apr_send(con->client_socket, &buf[o], &cntr) != APR_SUCCESS)
{
                   if (completion) {
                       /* when a send failure occurs, we need to decide
                        * whether to continue loading and caching the
  @@ -591,8 +595,11 @@
           } /* while client alive and more data to send */
       } /* loop and ap_bread while "ok" */
   
  +/* Remove this stuff, because flushing a socket doesn't make a lot of sense
  + * currently.
       if (!con->aborted)
   	ap_bflush(con->client);
  +*/
   
       return total_bytes_rcvd;
   }
  @@ -607,19 +614,23 @@
   void ap_proxy_send_headers(request_rec *r, const char *respline, apr_table_t *t)
   {
   	int i;
  -	BUFF *fp = r->connection->client;
  +	apr_socket_t *fp = r->connection->client_socket;
   	apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(t)->elts;
   
  -	ap_bvputs(fp, respline, CRLF, NULL);
  +	char *temp = apr_pstrcat(r->pool, respline, CRLF, NULL);
  +	apr_size_t len = strlen(temp);
  +	apr_send(fp, temp, &len);
   
   	for (i = 0; i < ap_table_elts(t)->nelts; ++i) {
               if (elts[i].key != NULL) {
  -                ap_bvputs(fp, elts[i].key, ": ", elts[i].val, CRLF, NULL);
  +                temp = apr_pstrcat(r->pool, elts[i].key, ": ", elts[i].val, CRLF, NULL);
  +                apr_send(fp, temp, &len);
                   apr_table_addn(r->headers_out, elts[i].key, elts[i].val);
               }
   	}
   
  -	ap_bputs(CRLF, fp);
  +        len = 2;
  +	apr_send(fp, CRLF, &len);
   }
   
   
  @@ -1133,9 +1144,9 @@
           if (!apr_isdigit(host[i]) && host[i] != '.')
               break;
   
  -    apr_set_remote_port(sock, port);
  +    apr_set_port(sock, APR_REMOTE, port);
       if (host[i] == '\0') {
  -        apr_set_remote_ipaddr(sock, host);
  +        apr_set_ipaddr(sock, APR_REMOTE, host);
           host = NULL;
       }
       for(;;)
  @@ -1171,9 +1182,10 @@
   unsigned ap_proxy_bputs2(const char *data, apr_socket_t *client, ap_cache_el *cache)
   {
       unsigned len = strlen(data);
  -    apr_send(client, data, &len);
       apr_file_t *cachefp = NULL;
   
  +    apr_send(client, data, &len);
  +
       if (ap_cache_el_data(cache, &cachefp) == APR_SUCCESS)
   	apr_puts(data, cachefp);
       return len;
  @@ -1227,19 +1239,23 @@
   int ap_proxy_cache_send(request_rec *r, ap_cache_el *c)
   {
       apr_file_t *cachefp = NULL;
  -    BUFF *fp = r->connection->client;
  +    apr_socket_t *fp = r->connection->client_socket;
       char buffer[500];
  +    apr_size_t len;
       
       ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
                    "Sending cache file for %s", c->name);
       if(ap_cache_el_data(c, &cachefp) != APR_SUCCESS)
           return HTTP_INTERNAL_SERVER_ERROR;
       /* send the response */
  -    if(apr_fgets(buffer, sizeof(buffer), cachefp))
  -        ap_bvputs(fp, buffer, NULL);
  +    if(apr_fgets(buffer, sizeof(buffer), cachefp)) {
  +        len = strlen(buffer);
  +        apr_send(fp, buffer, &len);
  +    }
       /* send headers */
       ap_cache_el_header_walk(c, ap_proxy_send_hdr_line, r, NULL);
  -    ap_bputs(CRLF, fp);
  +    len = 2;
  +    apr_send(fp, CRLF, &len);
       /* send data */
       /* XXX I changed the ap_proxy_send_fb call to use fp instead of cachefp.
        *     this compiles cleanly, but it is probably the completely wrong
  
  
  

Mime
View raw message