1
/* http.h - HTTP protocol handler
2
* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
4
* This file is part of GnuPG.
6
* GnuPG is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* GnuPG is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
26
struct uri_tuple *next;
27
const char *name; /* a pointer into name */
28
char *value; /* a pointer to value (a Nul is always appended) */
29
size_t valuelen; /* and the real length of the value */
30
/* because the value may contain embedded Nuls */
32
typedef struct uri_tuple *URI_TUPLE;
35
/* all these pointers point into buffer; most stuff is not escaped */
36
char *scheme; /* pointer to the scheme string (lowercase) */
37
char *host; /* host (converted to lowercase) */
38
ushort port; /* port (always set if the host is set) */
39
char *path; /* the path */
40
URI_TUPLE params; /* ";xxxxx" */
41
URI_TUPLE query; /* "?xxx=yyy" */
42
char buffer[1]; /* buffer which holds a (modified) copy of the URI */
44
typedef struct parsed_uri *PARSED_URI;
52
enum { /* put flag values into an enum, so that gdb can display them */
53
HTTP_FLAG_TRY_PROXY = 1,
54
HTTP_FLAG_NO_SHUTDOWN = 2,
60
unsigned int status_code;
67
HTTP_REQ_TYPE req_type;
68
byte *buffer; /* line buffer */
72
typedef struct http_context *HTTP_HD;
74
int http_open( HTTP_HD hd, HTTP_REQ_TYPE reqtype, const char *url,
76
void http_start_data( HTTP_HD hd );
77
int http_wait_response( HTTP_HD hd, unsigned int *ret_status );
78
void http_close( HTTP_HD hd );
80
int http_open_document( HTTP_HD hd, const char *document, unsigned int flags );