aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-21 15:28:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-21 15:28:54 +0100
commit7b4f90b2919c85fcafa663c96c754eb10c3595b8 (patch)
tree908fb3f62629a1b96d86162b2f3e68fa98247d65 /src/libutil/http.h
parent0481887fdf5ecfccca2b703efadf84823b245f13 (diff)
downloadrspamd-7b4f90b2919c85fcafa663c96c754eb10c3595b8.tar.gz
rspamd-7b4f90b2919c85fcafa663c96c754eb10c3595b8.zip
Add URL parsing utility.
Diffstat (limited to 'src/libutil/http.h')
-rw-r--r--src/libutil/http.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libutil/http.h b/src/libutil/http.h
index eefadee18..c6fcf0b83 100644
--- a/src/libutil/http.h
+++ b/src/libutil/http.h
@@ -53,6 +53,8 @@ struct rspamd_http_header {
*/
struct rspamd_http_message {
GString *url;
+ GString *host;
+ unsigned port;
GString *status;
struct rspamd_http_header *headers;
GString *body;
@@ -211,13 +213,20 @@ rspamd_http_connection_unref (struct rspamd_http_connection *conn)
void rspamd_http_connection_reset (struct rspamd_http_connection *conn);
/**
- * Create new HTTP reply
- * @param code code to pass
- * @return new reply object
+ * Create new HTTP message
+ * @param type request or response
+ * @return new http message
*/
struct rspamd_http_message * rspamd_http_new_message (enum http_parser_type type);
/**
+ * Create HTTP message from URL
+ * @param url
+ * @return new message or NULL
+ */
+struct rspamd_http_message* rspamd_http_message_from_url (const gchar *url);
+
+/**
* Append a header to reply
* @param rep
* @param name