Sort configuration variables.
[polipo.git] / http_parse.h
blob0305f9477ed8c6e8bae151e75afb0a57f0bc9294
1 /*
2 Copyright (c) 2003-2006 by Juliusz Chroboczek
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
23 typedef struct HTTPRange {
24 int from;
25 int to;
26 int full_length;
27 } HTTPRangeRec, *HTTPRangePtr;
29 extern int censorReferer;
31 void preinitHttpParser(void);
32 void initHttpParser(void);
33 int httpParseClientFirstLine(const char *buf, int offset,
34 int *method_return,
35 AtomPtr *url_return,
36 int *version_return);
37 int httpParseServerFirstLine(const char *buf,
38 int *status_return,
39 int *version_return,
40 AtomPtr *message_return);
42 int findEndOfHeaders(const char *buf, int from, int to, int *body_return);
44 int httpParseHeaders(int, AtomPtr, const char *, int, HTTPRequestPtr,
45 AtomPtr*, int*, CacheControlPtr,
46 HTTPConditionPtr *, int*,
47 time_t*, time_t*, time_t*, time_t*, time_t*,
48 int*, int*, char**, AtomPtr*,
49 HTTPRangePtr, HTTPRangePtr, char**, AtomPtr*, AtomPtr*);
51 int parseUrl(const char *url, int len,
52 int *x_return, int *y_return, int *port_return, int *z_return);
53 int urlIsLocal(const char *url, int len);
54 int urlIsSpecial(const char *url, int len);
55 int parseChunkSize(const char *buf, int i, int end, int *chunk_size_return);
56 int checkVia(AtomPtr, AtomPtr);