X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=include%2Fhttp.h;h=8403e358dad3153dad1383b486e58780d18f3211;hb=78ba3ee1d71032a1325036d5cefa8d0549d76ccd;hp=0873659acf2cde8299e887f9a79e5a63f18dc3c0;hpb=672dbb8f2fe881723f08bba084acd54703411342;p=doldaconnect.git diff --git a/include/http.h b/include/http.h index 0873659..8403e35 100644 --- a/include/http.h +++ b/include/http.h @@ -1,6 +1,6 @@ /* * Dolda Connect - Modular multiuser Direct Connect-style client - * Copyright (C) 2007 Fredrik Tolf (fredrik@dolda2000.com) + * Copyright (C) 2007 Fredrik Tolf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,21 +17,35 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef _HTTP_H +#ifndef _HTTP_H #define _HTTP_H +#include + +#include "utils.h" + struct hturlinfo { char *host; int port; - char *rest; + char *path; + char *query; + char *fragment; }; struct htconn { + int state; int fd; - struct 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; + int autoredir; }; struct htcookie { @@ -39,4 +53,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