httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-proxy/module-2.0 proxy_ftp.c
Date Fri, 13 Apr 2001 02:07:06 GMT
minfrin     01/04/12 19:07:06

  Modified:    module-2.0 proxy_ftp.c
  Log:
  Fixed a problem with FTP directories and charcters being chopped here
  and there.
  
  Revision  Changes    Path
  1.42      +6 -5      httpd-proxy/module-2.0/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/httpd-proxy/module-2.0/proxy_ftp.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- proxy_ftp.c	2001/04/12 01:57:48	1.41
  +++ proxy_ftp.c	2001/04/13 02:07:05	1.42
  @@ -340,6 +340,7 @@
   	ctx->buffer[0] = 0;
   
   	/* get a complete line */
  +	/* if the buffer overruns - throw data away */
   	while (!found && !APR_BRIGADE_EMPTY(ctx->in)) {
   	    char *pos, *response;
   	    apr_size_t len, max;
  @@ -354,7 +355,9 @@
   	    pos = memchr(response, APR_ASCII_LF, len);
   	    if (pos != NULL) {
   		if ((pos - response + 1) != len) {
  +		    len = pos - response + 1;
   		    apr_bucket_split(e, pos - response + 1);
  +		    
   		}
   		found = 1;
   	    }
  @@ -362,7 +365,9 @@
   	    if (len > max) {
   		len = max;
   	    }
  -	    apr_cpystrn(ctx->buffer+strlen(ctx->buffer), response, len);
  +/* strncat works here, but apr_cpystrn does not - the last char gets chopped, dunno why
*/
  +/*	    apr_cpystrn(ctx->buffer+strlen(ctx->buffer), response, len);*/
  +	    strncat(ctx->buffer, response, len);
   	    APR_BUCKET_REMOVE(e);
   	    apr_bucket_destroy(e);
   	}
  @@ -377,10 +382,6 @@
   	if (!found) {
   	    return APR_SUCCESS;
   	}
  -
  -ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  -                      "proxy: directory line: [%s]", ctx->buffer);
  -
   
   	/* a symlink? */
   	if (ctx->buffer[0] == 'l' && (filename=strstr(ctx->buffer, " -> ")) !=
NULL) {
  
  
  

Mime
View raw message