Experimental version.. Trying to move state information into URL parameters
[pazpar2-moved-to-github.git] / http.h
diff --git a/http.h b/http.h
index 907a19d..7501424 100644 (file)
--- a/http.h
+++ b/http.h
@@ -18,8 +18,16 @@ struct http_channel
     struct http_buf *oqueue;
     char version[10];
     struct http_proxy *proxy;
+    enum
+    {
+        Http_Idle,
+        Http_Busy      // Don't process new HTTP requests while we're busy
+    } state;
     NMEM nmem;
     WRBUF wrbuf;
+    struct http_request *request;
+    struct http_response *response;
+    struct http_channel *next; // for freelist
 };
 
 struct http_proxy //  attached to iochan for proxy connection
@@ -63,11 +71,12 @@ struct http_response
 };
 
 void http_set_proxyaddr(char *url);
-void http_init(int port);
+void http_init(const char *addr);
 void http_addheader(struct http_response *r, const char *name, const char *value);
 char *http_argbyname(struct http_request *r, char *name);
 char *http_headerbyname(struct http_request *r, char *name);
 struct http_response *http_create_response(struct http_channel *c);
+void http_send_response(struct http_channel *c);
 
 /*
  * Local variables: