* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifdef _HTTP_H
+#ifndef _HTTP_H
#define _HTTP_H
+#include <netdb.h>
+
+#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;
};
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