www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Panchenko <ale...@liwest.ru>
Subject Files from FTP servers are transmitted as text
Date Thu, 08 Aug 2002 07:28:30 GMT
Hi !

The function ftp_set_TYPE in proxy_ftp.c should be fixed.
Now because of the static variable used correct type is set only once,
and all subsequent file downloads use default type, resulting in
corrupted files downloaded as text.

The simpliest fix is to remove comparision with old type value:

 /* Set ftp server to TYPE {A,I,E} before transfer of a directory or file */
 static int ftp_set_TYPE(request_rec *r, BUFF *ctrl, char xfer_type)
     static char old_type[2] = {'A', '\0'};      /* After logon, mode is ASCII */
     int ret = HTTP_OK;
     int rc;
-    if (xfer_type == old_type[0])  // remove these lines.
-        return ret;
     /* set desired type */
     old_type[0] = xfer_type;
     ap_bvputs(ctrl, "TYPE ", old_type, CRLF, NULL);
     ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, r->server, "FTP: TYPE %s", old_type);

Best regards,
 Alexey                          mailto:alexey@liwest.ru

View raw message