aboutsummaryrefslogtreecommitdiffstats
path: root/common/http.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-02-08 20:11:19 +0000
committerWerner Koch <[email protected]>2011-02-08 20:11:19 +0000
commit2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845 (patch)
tree87e424f10a74c0cecce3c3ecc96b43eaca1b892c /common/http.h
parentFix ECDSA 521 bit signing. (diff)
downloadgnupg-2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845.tar.gz
gnupg-2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845.zip
Add finger support to dirmngr.
The basic network code from http.c is used for finger. This keeps the network related code at one place and we are able to use the somewhat matured code form http.c. Unfortunately I had to enhance the http code for more robustness and probably introduced new bugs. Test this code using gpg --fetch-key finger:[email protected] (I might be the last user of finger ;-)
Diffstat (limited to 'common/http.h')
-rw-r--r--common/http.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/http.h b/common/http.h
index 50c478c84..7a11b84f3 100644
--- a/common/http.h
+++ b/common/http.h
@@ -40,7 +40,8 @@ struct parsed_uri_s
char *scheme; /* Pointer to the scheme string (always lowercase). */
unsigned int is_http:1; /* This is a HTTP style URI. */
unsigned int use_tls:1; /* Whether TLS should be used. */
- char *auth; /* username/password for basic auth */
+ unsigned int opaque:1;/* Unknown scheme; PATH has the rest. */
+ char *auth; /* username/password for basic auth. */
char *host; /* Host (converted to lowercase). */
unsigned short port; /* Port (always set if the host is set). */
char *path; /* Path. */
@@ -54,7 +55,8 @@ typedef enum
{
HTTP_REQ_GET = 1,
HTTP_REQ_HEAD = 2,
- HTTP_REQ_POST = 3
+ HTTP_REQ_POST = 3,
+ HTTP_REQ_OPAQUE = 4 /* Internal use. */
}
http_req_t;
@@ -79,6 +81,13 @@ gpg_error_t _http_parse_uri (parsed_uri_t *ret_uri, const char *uri,
void http_release_parsed_uri (parsed_uri_t uri);
+gpg_error_t _http_raw_connect (http_t *r_hd,
+ const char *server, unsigned short port,
+ unsigned int flags, const char *srvtag,
+ gpg_err_source_t errsource);
+#define http_raw_connect(a,b,c,d,e) \
+ _http_raw_connect ((a),(b),(c),(d),(e), GPG_ERR_SOURCE_DEFAULT)
+
gpg_error_t _http_open (http_t *r_hd, http_req_t reqtype,
const char *url,
const char *auth,