summaryrefslogtreecommitdiff
path: root/osdep/Http.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/Http.cpp')
-rw-r--r--osdep/Http.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/osdep/Http.cpp b/osdep/Http.cpp
index 4fe298b3..064ccd0c 100644
--- a/osdep/Http.cpp
+++ b/osdep/Http.cpp
@@ -48,6 +48,8 @@ static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length);
static int ShttpOnHeadersComplete(http_parser *parser);
static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length);
static int ShttpOnMessageComplete(http_parser *parser);
+
+#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 1)
static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
ShttpOnMessageBegin,
ShttpOnUrl,
@@ -58,6 +60,17 @@ static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
ShttpOnBody,
ShttpOnMessageComplete
};
+#else
+static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
+ ShttpOnMessageBegin,
+ ShttpOnUrl,
+ ShttpOnHeaderField,
+ ShttpOnValue,
+ ShttpOnHeadersComplete,
+ ShttpOnBody,
+ ShttpOnMessageComplete
+};
+#endif
struct HttpPhyHandler
{