diff options
author | Roger Dingledine <arma@torproject.org> | 2002-06-26 22:45:49 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-06-26 22:45:49 +0000 |
commit | 9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a (patch) | |
tree | fac560bf2dce8a8d2b82e296b71ff24f59ab1a7a /src/httpap/http.h | |
parent | 766a465a6043ac4e643c398feb14f708fd0d863f (diff) | |
download | tor-9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a.tar tor-9a928eeb1215f0d7c9b6d0bb9e4571d0a16ed79a.tar.gz |
Initial revision
svn:r2
Diffstat (limited to 'src/httpap/http.h')
-rw-r--r-- | src/httpap/http.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/httpap/http.h b/src/httpap/http.h new file mode 100644 index 000000000..cc2d20ccf --- /dev/null +++ b/src/httpap/http.h @@ -0,0 +1,46 @@ +/* + * http.h + * HTTP parsers. + * + * Matej Pfajfar <mp292@cam.ac.uk> + */ + +/* + * Changes : + * $Log$ + * Revision 1.1 2002/06/26 22:45:50 arma + * Initial revision + * + * Revision 1.2 2002/04/02 14:27:33 badbytes + * Final finishes. + * + * Revision 1.1 2002/03/12 23:46:14 mp292 + * HTTP-related routines. + * + */ + +#define HTTPAP_MAXLEN 1024 /* maximum length of a line */ + +#define HTTPAP_CR '\015' +#define HTTPAP_LF '\012' +#define HTTPAP_CRLF "\015\012" + +#define HTTPAP_VERSION "HTTP/1.0" + +#define HTTPAP_STATUS_LINE_FORBIDDEN HTTPAP_VERSION " 403 Only local connections are allowed." HTTPAP_CRLF +#define HTTPAP_STATUS_LINE_VERSION_NOT_SUPPORTED HTTPAP_VERSION " 505 Only HTTP/1.0 is supported." HTTPAP_CRLF +#define HTTPAP_STATUS_LINE_UNAVAILABLE HTTPAP_VERSION " 503 Connection to the server failed." HTTPAP_CRLF +#define HTTPAP_STATUS_LINE_BAD_REQUEST HTTPAP_VERSION " 400 Invalid syntax." HTTPAP_CRLF +#define HTTPAP_STATUS_LINE_UNEXPECTED HTTPAP_VERSION " 500 Internal server error." HTTPAP_CRLF + +#define HTTPAP_HEADER_PROXY_CONNECTION "Proxy-Connection" +#define HTTPAP_HEADER_USER_AGENT "User-Agent" +#define HTTPAP_HEADER_REFERER "Referer" + +int http_get_line(int s, unsigned char **line, size_t *len, struct timeval *conn_tout); + +int http_get_version(unsigned char *rl, unsigned char **http_ver); + +int http_get_dest(unsigned char *rl, unsigned char **addr, unsigned char **port); + +int http_get_header_name(unsigned char *rl, unsigned char **hname); |