diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2009-01-07 16:29:47 +0100 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2009-01-11 00:37:00 +0100 |
| commit | b5d78b066a2da696eca1e321cdb4a53dd3557843 (patch) | |
| tree | c647694df7dc6ccfc157f112d92e88f593a2b964 /misc/http_client.h | |
| parent | 3af2b0c0ac1fc2536c8fca7b86d5f7455d82c763 (diff) | |
| download | btpd-b5d78b066a2da696eca1e321cdb4a53dd3557843.tar.gz btpd-b5d78b066a2da696eca1e321cdb4a53dd3557843.zip | |
Make the http client independent of events and use my iobuf.
Diffstat (limited to 'misc/http_client.h')
| -rw-r--r-- | misc/http_client.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/misc/http_client.h b/misc/http_client.h index e6a11af..0adc7da 100644 --- a/misc/http_client.h +++ b/misc/http_client.h @@ -1,6 +1,15 @@ #ifndef BTPD_HTTP_CLIENT_H #define BTPD_HTTP_CLIENT_H +struct http_url { + char *host; + char *uri; + uint16_t port; +}; + +struct http_url *http_url_parse(const char *url); +void http_url_free(struct http_url *url); + struct http_response { enum { HTTP_T_ERR, HTTP_T_CODE, HTTP_T_HEADER, HTTP_T_DATA, HTTP_T_DONE @@ -19,20 +28,16 @@ struct http_response { } v; }; -struct http_url { - char *host; - char *uri; - uint16_t port; -}; - struct http_req; - typedef void (*http_cb_t)(struct http_req *, struct http_response *, void *); -struct http_url *http_url_parse(const char *url); -void http_url_free(struct http_url *url); int http_get(struct http_req **out, const char *url, const char *hdrs, http_cb_t cb, void *arg); void http_cancel(struct http_req *req); +struct http_url *http_url_get(struct http_req *req); +int http_want_read(struct http_req *req); +int http_want_write(struct http_req *req); +int http_read(struct http_req *req, int sd); +int http_write(struct http_req *req, int sd); #endif |