1 /* $Id: http.h,v 1.13 2007-10-08 13:19:23 adam Exp $
2 Copyright (c) 2006-2007, Index Data.
4 This file is part of Pazpar2.
6 Pazpar2 is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Pazpar2; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
28 #define HTTP_BUF_SIZE 4096
32 struct http_buf *next;
35 typedef struct http_channel_observer_s *http_channel_observer_t;
40 struct http_buf *iqueue;
41 struct http_buf *oqueue;
43 struct http_proxy *proxy;
47 Http_Busy // Don't process new HTTP requests while we're busy
52 struct http_request *request;
53 struct http_response *response;
54 struct http_channel *next; // for freelist
55 char addr[20]; // forwarded address
56 http_channel_observer_t observers;
59 struct http_proxy // attached to iochan for proxy connection
62 struct http_channel *channel;
63 struct http_buf *oqueue;
71 struct http_header *next;
78 struct http_argument *next;
83 struct http_channel *channel;
84 char http_version[20];
90 struct http_header *headers;
91 struct http_argument *arguments;
98 struct http_channel *channel;
99 struct http_header *headers;
104 void http_set_proxyaddr(char *url, char *baseurl);
105 void http_init(const char *addr);
106 void http_addheader(struct http_response *r,
107 const char *name, const char *value);
108 struct http_header * http_header_append(struct http_channel *ch,
109 struct http_header * hp,
112 char *http_argbyname(struct http_request *r, char *name);
113 char *http_headerbyname(struct http_header *r, char *name);
114 struct http_response *http_create_response(struct http_channel *c);
115 void http_send_response(struct http_channel *c);
116 void urlencode(const char *i, char *o);
118 typedef void (*http_channel_destroy_t)(void *data, struct http_channel *c,
121 http_channel_observer_t http_add_observer(struct http_channel *c, void *data,
122 http_channel_destroy_t);
123 void http_observer_set_data2(http_channel_observer_t obs, void *data2);
125 void http_remove_observer(http_channel_observer_t obs);
126 struct http_channel *http_channel_observer_chan(http_channel_observer_t obs);
132 * indent-tabs-mode: nil
134 * vim: shiftwidth=4 tabstop=8 expandtab