[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.27 and 1.28

version 1.27, 2000/01/09 05:14:38 version 1.28, 2000/04/24 03:30:16
Line 104 
Line 104 
         char c, *cp, *ep, *portnum, *path, buf[4096];          char c, *cp, *ep, *portnum, *path, buf[4096];
         const char *savefile;          const char *savefile;
         char *line, *proxy, *host, *port;          char *line, *proxy, *host, *port;
           char *hosttail;
         volatile sig_t oldintr;          volatile sig_t oldintr;
         off_t hashbytes;          off_t hashbytes;
         char *cause = "unknown";          char *cause = "unknown";
Line 268 
Line 269 
                 return (0);                  return (0);
         }          }
   
         portnum = strchr(host, ':');                    /* find portnum */          if (*host == '[' && (hosttail = strrchr(host, ']')) != NULL &&
               (hosttail[1] == '\0' || hosttail[1] == ':')) {
                   host++;
                   *hosttail++ = '\0';
           } else
                   hosttail = host;
   
           portnum = strrchr(hosttail, ':');               /* find portnum */
         if (portnum != NULL)          if (portnum != NULL)
                 *portnum++ = '\0';                  *portnum++ = '\0';
   
Line 327 
Line 335 
                         fprintf(ttyout, "Requesting %s (via %s)\n",                          fprintf(ttyout, "Requesting %s (via %s)\n",
                             origline, proxyenv);                              origline, proxyenv);
         }          }
         snprintf(buf, sizeof(buf), "GET %s%s HTTP/1.0\r\nHost: %s\r\n\r\n",          if (strchr(host, ':')) {
             proxy ? "" : "/", path, host);                  snprintf(buf, sizeof(buf),
                       "GET %s%s HTTP/1.0\r\nHost: [%s]:%s\r\n\r\n",
                       proxy ? "" : "/", path, host, port);
           } else {
                   snprintf(buf, sizeof(buf),
                       "GET %s%s HTTP/1.0\r\nHost: %s:%s\r\n\r\n",
                       proxy ? "" : "/", path, host, port);
           }
         len = strlen(buf);          len = strlen(buf);
         if (write(s, buf, len) < len) {          if (write(s, buf, len) < len) {
                 warn("Writing HTTP request");                  warn("Writing HTTP request");

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