]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Treat the "shortcut icon" link as inline.
[wget] / src / http.c
index 500e4b9fbc32a9afa6bbdf803795ffe20caabecb..ad354eed788b414aadf6826afe6c907810cd922a 100644 (file)
@@ -44,12 +44,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # endif
 #endif
 
-#ifdef WINDOWS
-# include <winsock.h>
-#else
-# include <netdb.h>            /* for h_errno */
-#endif
-
 #include "wget.h"
 #include "utils.h"
 #include "url.h"
@@ -73,11 +67,6 @@ extern char *version_string;
 #ifndef errno
 extern int errno;
 #endif
-#ifndef h_errno
-# ifndef __CYGWIN__
-extern int h_errno;
-# endif
-#endif
 \f
 static int cookies_loaded_p;
 
@@ -756,8 +745,13 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
        }
       else
        {
+         /* Use the full path, i.e. one that includes the leading
+            slash and the query string, but is independent of proxy
+            setting.  */
+         char *pth = url_full_path (u);
          wwwauth = create_authorization_line (authenticate_h, user, passwd,
-                                              command, u->path);
+                                              command, pth);
+         xfree (pth);
        }
     }
 
@@ -812,6 +806,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
   if (proxy)
     full_path = xstrdup (u->url);
   else
+    /* 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".  */
     full_path = url_full_path (u);
 
   /* Allocate the memory for the request.  */
@@ -860,7 +857,7 @@ Accept: %s\r\n\
 
   /* Send the request to server.  */
 #ifdef HAVE_SSL
-  if (u->scheme == SCHEME_HTTPS)
+  if (conn->scheme == SCHEME_HTTPS)
     num_written = ssl_iwrite (ssl, request, strlen (request));
   else
 #endif /* HAVE_SSL */
@@ -883,7 +880,7 @@ Accept: %s\r\n\
   /* Before reading anything, initialize the rbuf.  */
   rbuf_initialize (&rbuf, sock);
 #ifdef HAVE_SSL
-  if (u->scheme == SCHEME_HTTPS)
+  if (conn->scheme == SCHEME_HTTPS)
     rbuf.ssl = ssl;
   else
     rbuf.ssl = NULL;
@@ -2167,7 +2164,7 @@ dump_hash (unsigned char *buf, const unsigned char *hash)
 
 /* Take the line apart to find the challenge, and compose a digest
    authorization header.  See RFC2069 section 2.1.2.  */
-char *
+static char *
 digest_authentication_encode (const char *au, const char *user,
                              const char *passwd, const char *method,
                              const char *path)