gnupg/util (ChangeLog http.c)
cvs user dshaw
cvs at cvs.gnupg.org
Wed Jun 22 05:49:30 CEST 2005
Date: Wednesday, June 22, 2005 @ 06:12:40
Author: dshaw
Path: /cvs/gnupg/gnupg/util
Modified: ChangeLog http.c
* http.c (send_request, http_open, http_open_document): Pass in auth
and proxyauth that can override the in-url auth.
-----------+
ChangeLog | 3 +++
http.c | 21 ++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
Index: gnupg/util/ChangeLog
diff -u gnupg/util/ChangeLog:1.192 gnupg/util/ChangeLog:1.193
--- gnupg/util/ChangeLog:1.192 Wed Jun 22 05:20:43 2005
+++ gnupg/util/ChangeLog Wed Jun 22 06:12:40 2005
@@ -1,5 +1,8 @@
2005-06-21 David Shaw <dshaw at jabberwocky.com>
+ * http.c (send_request, http_open, http_open_document): Pass in
+ auth and proxyauth that can override the in-url auth.
+
* http.c (send_request): Need == after the radix64-encoded basic
auth string.
Index: gnupg/util/http.c
diff -u gnupg/util/http.c:1.35 gnupg/util/http.c:1.36
--- gnupg/util/http.c:1.35 Wed Jun 22 05:20:43 2005
+++ gnupg/util/http.c Wed Jun 22 06:12:40 2005
@@ -69,7 +69,7 @@
static int insert_escapes( byte *buffer, const byte *string,
const byte *special );
static URI_TUPLE parse_tuple( byte *string );
-static int send_request( HTTP_HD hd, const char *proxy );
+static int send_request( HTTP_HD hd, const char *proxy, const char *proxyauth);
static byte *build_rel_path( PARSED_URI uri );
static int parse_response( HTTP_HD hd );
@@ -146,7 +146,8 @@
int
http_open( HTTP_HD hd, HTTP_REQ_TYPE reqtype, const char *url,
- unsigned int flags, const char *proxy )
+ const char *auth, unsigned int flags, const char *proxy,
+ const char *proxyauth )
{
int rc;
@@ -162,7 +163,9 @@
rc = parse_uri( &hd->uri, url );
if( !rc ) {
- rc = send_request( hd, proxy );
+ if(auth)
+ hd->uri->auth=auth;
+ rc = send_request( hd, proxy, proxyauth );
if( !rc ) {
hd->fp_write = iobuf_sockopen( hd->sock , "w" );
if( hd->fp_write )
@@ -225,12 +228,13 @@
int
-http_open_document( HTTP_HD hd, const char *document,
- unsigned int flags, const char *proxy )
+http_open_document( HTTP_HD hd, const char *document, const char *auth,
+ unsigned int flags, const char *proxy,
+ const char *proxyauth )
{
int rc;
- rc = http_open( hd, HTTP_REQ_GET, document, flags, proxy );
+ rc = http_open(hd, HTTP_REQ_GET, document, auth, flags, proxy, proxyauth );
if( rc )
return rc;
@@ -503,7 +507,7 @@
* Returns 0 if the request was successful
*/
static int
-send_request( HTTP_HD hd, const char *proxy )
+send_request( HTTP_HD hd, const char *proxy, const char *proxyauth )
{
const byte *server;
byte *request, *p;
@@ -527,6 +531,9 @@
}
hd->sock = connect_server( *uri->host? uri->host : "localhost",
uri->port? uri->port : 80, 0, NULL );
+ if(proxyauth)
+ uri->auth=proxyauth;
+
if(uri->auth)
{
char *x=make_radix64_string(uri->auth,strlen(uri->auth));
More information about the Gnupg-commits
mailing list