X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=include%2Fhttp.h;h=e3cc1d4ca4b9cd145ce9e07c7290e74b1ee84900;hb=2b6703ac37a2c0f17923535d68fdf0ac2debedea;hp=0456d5aa105408eac7afc3a01ad395525bbab76a;hpb=95c14b735e08d5350a43722b4b02889c4f0c6c2a;p=doldaconnect.git diff --git a/include/http.h b/include/http.h index 0456d5a..e3cc1d4 100644 --- a/include/http.h +++ b/include/http.h @@ -20,19 +20,31 @@ #ifndef _HTTP_H #define _HTTP_H +#include + +#include "utils.h" + struct hturlinfo { char *host; int port; char *path; char *query; + char *fragment; }; struct htconn { + int state; int fd; - char *outbuf, *inbuf; + struct addrinfo *ailist, *curai; + char *outbuf, *inbuf, *databuf; size_t outbufsize, outbufdata; size_t inbufsize, inbufdata; + size_t databufsize, databufdata; struct hturlinfo *url; + int rescode; + char *resstr; + struct strpair *headers; + ssize_t tlen, rxd, chl; }; struct htcookie { @@ -40,4 +52,11 @@ struct htcookie { char *name, *val; }; +struct hturlinfo *parseurl(char *url); +void freeurl(struct hturlinfo *ui); +void freehtconn(struct htconn *cn); +struct htconn *htconnect(struct hturlinfo *ui); +int htpollflags(struct htconn *hc); +int htprocess(struct htconn *hc, int pollflags); + #endif