Skip to content

Commit

Permalink
[Rework] Finish http code split and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Feb 15, 2019
1 parent 541b15d commit a841d41
Show file tree
Hide file tree
Showing 18 changed files with 1,738 additions and 1,584 deletions.
3 changes: 2 additions & 1 deletion contrib/http-parser/http_parser.c
Expand Up @@ -122,6 +122,7 @@ do { \
#define KEEP_ALIVE "keep-alive"
#define CLOSE "close"

enum rspamd_http_message_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };

static const char *method_strings[] =
{
Expand Down Expand Up @@ -1981,7 +1982,7 @@ http_method_str (enum http_method m)


void
http_parser_init (http_parser *parser, enum http_parser_type t)
http_parser_init (http_parser *parser, int t)
{
void *data = parser->data; /* preserve application data */
memset(parser, 0, sizeof(*parser));
Expand Down
4 changes: 1 addition & 3 deletions contrib/http-parser/http_parser.h
Expand Up @@ -124,8 +124,6 @@ enum http_method
};


enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };


/* Flag values for http_parser.flags field */
enum flags
Expand Down Expand Up @@ -280,7 +278,7 @@ struct http_parser_url {
*/
unsigned long http_parser_version(void);

void http_parser_init(http_parser *parser, enum http_parser_type type);
void http_parser_init(http_parser *parser, int type);


size_t http_parser_execute(http_parser *parser,
Expand Down
1 change: 1 addition & 0 deletions src/controller.c
Expand Up @@ -21,6 +21,7 @@
#include "libutil/map_helpers.h"
#include "libutil/map_private.h"
#include "libutil/http_private.h"
#include "libutil/http_router.h"
#include "libstat/stat_api.h"
#include "rspamd.h"
#include "libserver/worker_util.h"
Expand Down
4 changes: 2 additions & 2 deletions src/fuzzy_storage.c
Expand Up @@ -34,10 +34,10 @@
#include "libcryptobox/keypairs_cache.h"
#include "libcryptobox/keypair.h"
#include "libserver/rspamd_control.h"
#include "libutil/map_private.h"
#include "libutil/hash.h"
#include "libutil/map_private.h"
#include "libutil/http_private.h"
#include "libutil/hash.h"
#include "libutil/http_router.h"
#include "unix-std.h"

#include <math.h>
Expand Down
1 change: 1 addition & 0 deletions src/libserver/url.c
Expand Up @@ -46,6 +46,7 @@
#include "message.h"
#include "multipattern.h"
#include "contrib/uthash/utlist.h"
#include "contrib/http-parser/http_parser.h"
#include <unicode/utf8.h>
#include <unicode/uchar.h>

Expand Down
1 change: 1 addition & 0 deletions src/libserver/worker_util.c
Expand Up @@ -24,6 +24,7 @@
#include "libutil/map.h"
#include "libutil/map_private.h"
#include "libutil/http_private.h"
#include "libutil/http_router.h"

#ifdef WITH_GPERF_TOOLS
#include <gperftools/profiler.h>
Expand Down
3 changes: 3 additions & 0 deletions src/libutil/CMakeLists.txt
Expand Up @@ -6,7 +6,10 @@ SET(LIBRSPAMDUTILSRC
${CMAKE_CURRENT_SOURCE_DIR}/expression.c
${CMAKE_CURRENT_SOURCE_DIR}/fstring.c
${CMAKE_CURRENT_SOURCE_DIR}/hash.c
${CMAKE_CURRENT_SOURCE_DIR}/http_util.c
${CMAKE_CURRENT_SOURCE_DIR}/http_message.c
${CMAKE_CURRENT_SOURCE_DIR}/http_connection.c
${CMAKE_CURRENT_SOURCE_DIR}/http_router.c
${CMAKE_CURRENT_SOURCE_DIR}/logger.c
${CMAKE_CURRENT_SOURCE_DIR}/map.c
${CMAKE_CURRENT_SOURCE_DIR}/map_helpers.c
Expand Down

0 comments on commit a841d41

Please sign in to comment.