[BACK]Return to fetch.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ftp

Diff for /src/usr.bin/ftp/fetch.c between version 1.28 and 1.29

version 1.28, 2000/04/24 03:30:16 version 1.29, 2000/05/02 00:54:53
Line 102 
Line 102 
         volatile int s;          volatile int s;
         size_t len;          size_t len;
         char c, *cp, *ep, *portnum, *path, buf[4096];          char c, *cp, *ep, *portnum, *path, buf[4096];
           char pbuf[NI_MAXSERV];
         const char *savefile;          const char *savefile;
         char *line, *proxy, *host, *port;          char *line, *proxy, *host, *port;
         char *hosttail;          char *hosttail;
Line 316 
Line 317 
                         continue;                          continue;
                 }                  }
   
                   /* get port in numeric */
                   if (getnameinfo(res->ai_addr, res->ai_addrlen, NULL, 0,
                       pbuf, sizeof(pbuf), NI_NUMERICSERV) == 0)
                           port = pbuf;
                   else
                           port = NULL;
   
                 break;                  break;
         }          }
         freeaddrinfo(res0);          freeaddrinfo(res0);
Line 337 
Line 345 
         }          }
         if (strchr(host, ':')) {          if (strchr(host, ':')) {
                 snprintf(buf, sizeof(buf),                  snprintf(buf, sizeof(buf),
                     "GET %s%s HTTP/1.0\r\nHost: [%s]:%s\r\n\r\n",                      "GET %s%s HTTP/1.0\r\nHost: [%s]%s%s\r\n\r\n",
                     proxy ? "" : "/", path, host, port);                      proxy ? "" : "/", path, host,
                       port ? ":" : "", port ? port : "");
         } else {          } else {
                 snprintf(buf, sizeof(buf),                  snprintf(buf, sizeof(buf),
                     "GET %s%s HTTP/1.0\r\nHost: %s:%s\r\n\r\n",                      "GET %s%s HTTP/1.0\r\nHost: %s%s%s\r\n\r\n",
                     proxy ? "" : "/", path, host, port);                      proxy ? "" : "/", path, host,
                       port ? ":" : "", port ? port : "");
         }          }
         len = strlen(buf);          len = strlen(buf);
         if (write(s, buf, len) < len) {          if (write(s, buf, len) < len) {

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29