]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Fix warnings reported by gcc -Wstrict-prototypes -Wmissing-prototypes.
[wget] / src / http.c
index d046eaea5f65261f5d302dc4790a181fcf986b5c..b7580335fa8729b5f9f41846f4d4cfdd70297b8e 100644 (file)
@@ -148,7 +148,7 @@ struct request {
    called before the request can be used.  */
 
 static struct request *
-request_new ()
+request_new (void)
 {
   struct request *req = xnew0 (struct request);
   req->hcapacity = 8;
@@ -1216,6 +1216,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
 
   req = request_new ();
   {
+    char *meth_arg;
     const char *meth = "GET";
     if (*dt & HEAD_ONLY)
       meth = "HEAD";
@@ -1224,8 +1225,18 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
     /* Use the full path, i.e. one that includes the leading slash and
        the query string.  E.g. if u->path is "foo/bar" and u->query is
        "param=value", full_path will be "/foo/bar?param=value".  */
-    request_set_method (req, meth,
-                       proxy ? xstrdup (u->url) : url_full_path (u));
+    if (proxy
+#ifdef HAVE_SSL
+       /* When using SSL over proxy, CONNECT establishes a direct
+          connection to the HTTPS server.  Therefore use the same
+          argument as when talking to the server directly. */
+       && u->scheme != SCHEME_HTTPS
+#endif
+       )
+      meth_arg = xstrdup (u->url);
+    else
+      meth_arg = url_full_path (u);
+    request_set_method (req, meth, meth_arg);
   }
 
   request_set_header (req, "Referer", (char *) hs->referer, rel_none);
@@ -2640,13 +2651,12 @@ http_atotm (const char *time_string)
         to prevent garbage from the stack influencing strptime.  */
       xzero (t);
 
-      /* Note that Solaris strptime fails to recognize English month
-        names under non-English locales.  We work around this by not
-        setting the LC_TIME category.  Another way would be to
-        temporarily set locale to C before invoking strptime, but
-        that's slow and messy.  GNU strptime does not have this
-        problem because it recognizes English names along with the
-        local ones.  */
+      /* Solaris strptime fails to recognize English month names in
+        non-English locales, which we work around by not setting the
+        LC_TIME category.  Another way would be to temporarily set
+        locale to C before invoking strptime, but that's slow and
+        messy.  GNU strptime does not have this problem because it
+        recognizes English month names along with the local ones.  */
 
       if (check_end (strptime (time_string, time_formats[i], &t)))
        return mktime_from_utc (&t);
@@ -2671,8 +2681,8 @@ http_atotm (const char *time_string)
    and Microsoft-specific.  */
 
 /* Create the authentication header contents for the `Basic' scheme.
-   This is done by encoding the string `USER:PASS' in base64 and
-   prepending `HEADER: Basic ' to it.  */
+   This is done by encoding the string "USER:PASS" to base64 and
+   prepending the string "Basic " in front of it.  */
 
 static char *
 basic_authentication_encode (const char *user, const char *passwd)