X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Freq.h;h=942ff3505f1d39f7c0641ec51d02b7ad001b51a3;hb=d1bd343cd855cb9b5815d5e636b4e70e766c1f6a;hp=b566dd24a1256859b7b0565ccdae1322b9d90c3f;hpb=337333968e3d06cf5f1fa5198eeba3121aee467a;p=ashd.git diff --git a/lib/req.h b/lib/req.h index b566dd2..942ff35 100644 --- a/lib/req.h +++ b/lib/req.h @@ -1,16 +1,22 @@ #ifndef _LIB_HTREQ_H #define _LIB_HTREQ_H -struct htreq { - char *method, *url, *ver; - char *restbuf, *rest; +struct hthead { + char *method, *url, *ver, *msg; + int code; + char *rest; char ***headers; int noheaders; }; -struct htreq *mkreq(char *method, char *url, char *ver); -void freereq(struct htreq *req); -void reqpreheader(struct htreq *req, char *name, char *val); -void reqappheader(struct htreq *req, char *name, char *val); +struct hthead *mkreq(char *method, char *url, char *ver); +struct hthead *mkresp(int code, char *msg, char *ver); +void freehthead(struct hthead *head); +char *getheader(struct hthead *head, char *name); +void headpreheader(struct hthead *head, const char *name, const char *val); +void headappheader(struct hthead *head, const char *name, const char *val); +int sendreq(int sock, struct hthead *req); +int recvreq(int sock, struct hthead **reqp); +void replrest(struct hthead *head, char *rest); #endif