]> granicus.if.org Git - apache/commitdiff
resolved conflicts (2) in PASV handling from original commit
authorChuck Murcko <chuck@apache.org>
Mon, 12 Jun 2000 22:13:08 +0000 (22:13 +0000)
committerChuck Murcko <chuck@apache.org>
Mon, 12 Jun 2000 22:13:08 +0000 (22:13 +0000)
PR:
Obtained from:
Submitted by: Chuck Murcko
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85556 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_ftp.c

index 301bffeb62924a31755c254242bfaa1bc26fc390..e4cac26ba1ba93b66af12271dd8aa31457ab646d 100644 (file)
@@ -811,7 +811,6 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el  *c, char *url)
         return HTTP_INTERNAL_SERVER_ERROR;
     }
     else {
-<<<<<<< proxy_ftp.c
         pasv[i - 1] = '\0';
         pstr = strtok(pasv, " ");    /* separate result code */
         if (pstr != NULL) {
@@ -842,44 +841,8 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el  *c, char *url)
 
             if (ap_proxy_doconnect(dsock, inet_ntoa(destaddr), pport, r) == -1) {
                 return ap_proxyerror(r, HTTP_BAD_GATEWAY,
-=======
-       pasv[i - 1] = '\0';
-       pstr = strtok(pasv, " ");       /* separate result code */
-       if (pstr != NULL) {
-           presult = atoi(pstr);
-           if (*(pstr + strlen(pstr) + 1) == '=')
-               pstr += strlen(pstr) + 2;
-           else
-           {
-               pstr = strtok(NULL, "(");  /* separate address & port params */
-               if (pstr != NULL)
-                   pstr = strtok(NULL, ")");
-           }
-       }
-       else
-           presult = atoi(pasv);
-
-       Explain1("FTP: returned status %d", presult);
-
-       if (presult == 227 && pstr != NULL && (sscanf(pstr,
-                "%d,%d,%d,%d,%d,%d", &h3, &h2, &h1, &h0, &p1, &p0) == 6)) {
-           /* pardon the parens, but it makes gcc happy */
-           paddr = (((((h3 << 8) + h2) << 8) + h1) << 8) + h0;
-           pport = (p1 << 8) + p0;
-           Explain5("FTP: contacting host %d.%d.%d.%d:%d",
-                    h3, h2, h1, h0, pport);
-           data_addr.sin_family = AF_INET;
-           data_addr.sin_addr.s_addr = htonl(paddr);
-           data_addr.sin_port = htons(pport);
-           i = ap_proxy_doconnect(dsock, &data_addr, r);
-
-           if (i == -1) {
-                char buf[120];
-               return ap_proxyerror(r, HTTP_BAD_GATEWAY,
->>>>>>> 1.8
                                      ap_pstrcat(r->pool,
                                                 "Could not connect to remote machine: ",
-<<<<<<< proxy_ftp.c
                                                 strerror(errno), NULL));
             }
             else {
@@ -904,38 +867,6 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el  *c, char *url)
         ap_set_local_ipaddr(dsock, npaddr);
         
         if (ap_setsocketopt(dsock, APR_SO_REUSEADDR, one) != APR_SUCCESS) {
-=======
-                                                ap_strerror(errno, buf, 
-                                                          sizeof(buf)), NULL));
-           }
-           else {
-               pasvmode = 1;
-           }
-       }
-       else
-           ap_pclosesocket(p, dsock);  /* and try the regular way */
-    }
-
-    if (!pasvmode) {           /* set up data connection */
-       clen = sizeof(struct sockaddr_in);
-       if (getsockname(sock, (struct sockaddr *) &server, &clen) < 0) {
-           ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-                        "proxy: error getting socket address");
-           ap_bclose(f);
-           return HTTP_INTERNAL_SERVER_ERROR;
-       }
-
-       dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP);
-       if (dsock == -1) {
-           ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
-                        "proxy: error creating socket");
-           ap_bclose(f);
-           return HTTP_INTERNAL_SERVER_ERROR;
-       }
-
-       if (setsockopt(dsock, SOL_SOCKET, SO_REUSEADDR, (void *) &one,
-                      sizeof(one)) == -1) {
->>>>>>> 1.8
 #ifndef _OSD_POSIX /* BS2000 has this option "always on" */
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "proxy: error setting reuseaddr option");