aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:45:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:45:28 +0100
commite0483657ff6cf1adc828ccce457814d61fe90a0d (patch)
tree5183e4163f40b81b3e7d5f51488d360883782154 /src/libutil/http.h
parent7962087e808fb824aa3af6d41d02abc92916ba1e (diff)
downloadrspamd-e0483657ff6cf1adc828ccce457814d61fe90a0d.tar.gz
rspamd-e0483657ff6cf1adc828ccce457814d61fe90a0d.zip
Unify code style.
Diffstat (limited to 'src/libutil/http.h')
-rw-r--r--src/libutil/http.h95
1 files changed, 52 insertions, 43 deletions
diff --git a/src/libutil/http.h b/src/libutil/http.h
index 695f23896..c6a142e3b 100644
--- a/src/libutil/http.h
+++ b/src/libutil/http.h
@@ -67,7 +67,7 @@ struct rspamd_http_message {
* Options for HTTP connection
*/
enum rspamd_http_options {
- RSPAMD_HTTP_BODY_PARTIAL = 0x1//!< RSPAMD_HTTP_BODY_PARTIAL
+ RSPAMD_HTTP_BODY_PARTIAL = 0x1 //!< RSPAMD_HTTP_BODY_PARTIAL
};
struct rspamd_http_connection_private;
@@ -76,20 +76,24 @@ struct rspamd_http_connection_router;
struct rspamd_http_connection_entry;
typedef int (*rspamd_http_body_handler_t) (struct rspamd_http_connection *conn,
- struct rspamd_http_message *msg,
- const gchar *chunk,
- gsize len);
+ struct rspamd_http_message *msg,
+ const gchar *chunk,
+ gsize len);
-typedef void (*rspamd_http_error_handler_t) (struct rspamd_http_connection *conn, GError *err);
+typedef void (*rspamd_http_error_handler_t) (struct rspamd_http_connection *conn,
+ GError *err);
typedef int (*rspamd_http_finish_handler_t) (struct rspamd_http_connection *conn,
- struct rspamd_http_message *msg);
+ struct rspamd_http_message *msg);
-typedef int (*rspamd_http_router_handler_t) (struct rspamd_http_connection_entry *conn_ent,
- struct rspamd_http_message *msg);
-typedef void (*rspamd_http_router_error_handler_t) (struct rspamd_http_connection_entry *conn_ent,
- GError *err);
-typedef void (*rspamd_http_router_finish_handler_t) (struct rspamd_http_connection_entry *conn_ent);
+typedef int (*rspamd_http_router_handler_t) (struct rspamd_http_connection_entry
+ *conn_ent,
+ struct rspamd_http_message *msg);
+typedef void (*rspamd_http_router_error_handler_t) (struct
+ rspamd_http_connection_entry *conn_ent,
+ GError *err);
+typedef void (*rspamd_http_router_finish_handler_t) (struct
+ rspamd_http_connection_entry *conn_ent);
/**
* HTTP connection structure
@@ -132,12 +136,12 @@ struct rspamd_http_connection_router {
* @param opts options
* @return new connection structure
*/
-struct rspamd_http_connection* rspamd_http_connection_new (
- rspamd_http_body_handler_t body_handler,
- rspamd_http_error_handler_t error_handler,
- rspamd_http_finish_handler_t finish_handler,
- enum rspamd_http_options opts,
- enum rspamd_http_connection_type type);
+struct rspamd_http_connection * rspamd_http_connection_new (
+ rspamd_http_body_handler_t body_handler,
+ rspamd_http_error_handler_t error_handler,
+ rspamd_http_finish_handler_t finish_handler,
+ enum rspamd_http_options opts,
+ enum rspamd_http_connection_type type);
/**
* Handle a request using socket fd and user data ud
@@ -146,11 +150,11 @@ struct rspamd_http_connection* rspamd_http_connection_new (
* @param fd fd to read/write
*/
void rspamd_http_connection_read_message (
- struct rspamd_http_connection *conn,
- gpointer ud,
- gint fd,
- struct timeval *timeout,
- struct event_base *base);
+ struct rspamd_http_connection *conn,
+ gpointer ud,
+ gint fd,
+ struct timeval *timeout,
+ struct event_base *base);
/**
* Send reply using initialised connection
@@ -160,14 +164,14 @@ void rspamd_http_connection_read_message (
* @param fd fd to read/write
*/
void rspamd_http_connection_write_message (
- struct rspamd_http_connection *conn,
- struct rspamd_http_message *msg,
- const gchar *host,
- const gchar *mime_type,
- gpointer ud,
- gint fd,
- struct timeval *timeout,
- struct event_base *base);
+ struct rspamd_http_connection *conn,
+ struct rspamd_http_message *msg,
+ const gchar *host,
+ const gchar *mime_type,
+ gpointer ud,
+ gint fd,
+ struct timeval *timeout,
+ struct event_base *base);
/**
* Free connection structure
@@ -183,7 +187,7 @@ void rspamd_http_connection_free (struct rspamd_http_connection *conn);
static inline struct rspamd_http_connection *
rspamd_http_connection_ref (struct rspamd_http_connection *conn)
{
- conn->ref ++;
+ conn->ref++;
return conn;
}
@@ -210,7 +214,7 @@ void rspamd_http_connection_reset (struct rspamd_http_connection *conn);
* @param code code to pass
* @return new reply object
*/
-struct rspamd_http_message* rspamd_http_new_message (enum http_parser_type type);
+struct rspamd_http_message * rspamd_http_new_message (enum http_parser_type type);
/**
* Append a header to reply
@@ -218,14 +222,17 @@ struct rspamd_http_message* rspamd_http_new_message (enum http_parser_type type)
* @param name
* @param value
*/
-void rspamd_http_message_add_header (struct rspamd_http_message *rep, const gchar *name, const gchar *value);
+void rspamd_http_message_add_header (struct rspamd_http_message *rep,
+ const gchar *name,
+ const gchar *value);
/**
* Search for a specified header in message
* @param rep message
* @param name name of header
*/
-const gchar* rspamd_http_message_find_header (struct rspamd_http_message *rep, const gchar *name);
+const gchar * rspamd_http_message_find_header (struct rspamd_http_message *rep,
+ const gchar *name);
/**
* Free HTTP reply
@@ -249,18 +256,18 @@ time_t rspamd_http_parse_date (const gchar *header, gsize len);
* the specified directory
* @return
*/
-struct rspamd_http_connection_router* rspamd_http_router_new (
- rspamd_http_router_error_handler_t eh,
- rspamd_http_router_finish_handler_t fh,
- struct timeval *timeout,
- struct event_base *base,
- const char *default_fs_path);
+struct rspamd_http_connection_router * rspamd_http_router_new (
+ rspamd_http_router_error_handler_t eh,
+ rspamd_http_router_finish_handler_t fh,
+ struct timeval *timeout,
+ struct event_base *base,
+ const char *default_fs_path);
/**
* Add new path to the router
*/
void rspamd_http_router_add_path (struct rspamd_http_connection_router *router,
- const gchar *path, rspamd_http_router_handler_t handler);
+ const gchar *path, rspamd_http_router_handler_t handler);
/**
* Handle new accepted socket
@@ -268,8 +275,10 @@ void rspamd_http_router_add_path (struct rspamd_http_connection_router *router,
* @param fd server socket
* @param ud opaque userdata
*/
-void rspamd_http_router_handle_socket (struct rspamd_http_connection_router *router,
- gint fd, gpointer ud);
+void rspamd_http_router_handle_socket (
+ struct rspamd_http_connection_router *router,
+ gint fd,
+ gpointer ud);
/**
* Free router and all connections associated