#ifndef HTTP_H
#define HTTP_H
+#include <yaz/wrbuf.h>
+
#include "eventl.h"
// Generic I/O buffer
-struct http_buf
-{
-#define HTTP_BUF_SIZE 4096
- char buf[4096];
- int offset;
- int len;
- struct http_buf *next;
-};
-
+struct http_buf;
typedef struct http_channel_observer_s *http_channel_observer_t;
+typedef struct http_server *http_server_t;
+typedef struct http_sessions *http_sessions_t;
+
struct http_channel
{
IOCHAN iochan;
char addr[20]; // forwarded address
http_channel_observer_t observers;
struct conf_server *server;
+ http_server_t http_server;
+ http_sessions_t http_sessions;
};
struct http_proxy // attached to iochan for proxy connection
char *content_type;
};
+void http_mutex_init(struct conf_server *server);
+void http_server_destroy(http_server_t hs);
+
void http_set_proxyaddr(const char *url, struct conf_server *ser);
int http_init(const char *addr, struct conf_server *ser);
void http_close_server(struct conf_server *ser);
void http_command(struct http_channel *c);
+http_sessions_t http_sessions_create(void);
+void http_sessions_destroy(http_sessions_t hs);
+
#endif
/*