diff options
author | Werner Koch <wk@gnupg.org> | 1999-01-16 21:26:09 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-01-16 21:26:09 +0100 |
commit | 38008c1c208f3ad4d7c1d0fe9b9056d5f9e21739 (patch) | |
tree | 0cb2ebfa42f1153e1a611496ef61d51976967494 /include | |
parent | See ChangeLog: Sat Jan 16 12:03:27 CET 1999 Werner Koch (diff) | |
download | gnupg2-38008c1c208f3ad4d7c1d0fe9b9056d5f9e21739.tar.xz gnupg2-38008c1c208f3ad4d7c1d0fe9b9056d5f9e21739.zip |
See ChangeLog: Sat Jan 16 21:25:17 CET 1999 Werner Koch
Diffstat (limited to 'include')
-rw-r--r-- | include/http.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/http.h b/include/http.h new file mode 100644 index 000000000..a439b4b81 --- /dev/null +++ b/include/http.h @@ -0,0 +1,62 @@ +/* http.h - HTTP protocol handler + * Copyright (C) 1999 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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 + */ +#ifndef G10_HTTP_H +#define G10_HTTP_H 1 + +#include "iobuf.h" + +struct uri_tuple { + struct uri_tuple *next; + const char *name; /* a pointer into name */ + char *value; /* a pointer to value (a Nul is always appended) */ + size_t valuelen; /* and the real length of the value */ + /* because the value may contain embedded Nuls */ +}; +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 *host; /* host (converted to lowercase) */ + ushort port; /* port (always set if the host is set) */ + char *path; /* the path */ + URI_TUPLE params; /* ";xxxxx" */ + URI_TUPLE query; /* "?xxx=yyy" */ + char buffer[1]; /* buffer which holds a (modified) copy of the URI */ +}; +typedef struct parsed_uri *PARSED_URI; + +struct http_context { + int initialized; + unsigned int status_code; + int socket; + IOBUF fp_read; + IOBUF fp_write; + int is_http_0_9; + PARSED_URI uri; + byte *buffer; /* line buffer */ + unsigned buffer_size; +}; +typedef struct http_context *HTTP_HD; + +int open_http_document( HTTP_HD hd, const char *document, unsigned int flags ); +void close_http_document( HTTP_HD hd ); + +#endif /*G10_HTTP_H*/ |