aboutsummaryrefslogtreecommitdiffstats
path: root/include/http.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/http.h')
-rw-r--r--include/http.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/include/http.h b/include/http.h
index b53ac9f9f..b9ce5b130 100644
--- a/include/http.h
+++ b/include/http.h
@@ -1,5 +1,6 @@
/* http.h - HTTP protocol handler
- * Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000, 2001, 2003, 2004,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -15,12 +16,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
*/
+
#ifndef G10_HTTP_H
#define G10_HTTP_H 1
-#include "iobuf.h"
+#include "../common/iobuf.h"
struct uri_tuple {
struct uri_tuple *next;
@@ -34,6 +37,7 @@ typedef struct uri_tuple *URI_TUPLE;
struct parsed_uri {
/* all these pointers point into buffer; most stuff is not escaped */
char *scheme; /* pointer to the scheme string (lowercase) */
+ char *auth; /* username/password for basic auth */
char *host; /* host (converted to lowercase) */
ushort port; /* port (always set if the host is set) */
char *path; /* the path */
@@ -49,19 +53,20 @@ typedef enum {
HTTP_REQ_POST = 3
} HTTP_REQ_TYPE;
-enum { /* put flag values into an enum, so that gdb can display them */
- HTTP_FLAG_TRY_PROXY = 1,
- HTTP_FLAG_NO_SHUTDOWN = 2,
- HTTP_FLAG_TRY_SRV = 3
-};
+/* put flag values into an enum, so that gdb can display them */
+enum
+ {
+ HTTP_FLAG_NO_SHUTDOWN = 1,
+ HTTP_FLAG_TRY_SRV = 2
+ };
struct http_context {
int initialized;
unsigned int status_code;
int sock;
int in_data;
- IOBUF fp_read;
- IOBUF fp_write;
+ iobuf_t fp_read;
+ iobuf_t fp_write;
int is_http_0_9;
PARSED_URI uri;
HTTP_REQ_TYPE req_type;
@@ -72,11 +77,11 @@ struct http_context {
typedef struct http_context *HTTP_HD;
int http_open( HTTP_HD hd, HTTP_REQ_TYPE reqtype, const char *url,
- unsigned int flags );
+ char *auth, unsigned int flags, const char *proxy );
void http_start_data( HTTP_HD hd );
int http_wait_response( HTTP_HD hd, unsigned int *ret_status );
void http_close( HTTP_HD hd );
-
-int http_open_document( HTTP_HD hd, const char *document, unsigned int flags );
+int http_open_document( HTTP_HD hd, const char *document, char *auth,
+ unsigned int flags, const char *proxy );
#endif /*G10_HTTP_H*/