summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-08 15:09:09 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-08 15:09:09 -0700
commit536feb632ce13f460e4e0406f33664fb1253425d (patch)
treea0f8c3fd92fa7dcd8e829c2b4dec6d1a073e66ce /service
parentcafa41ba4d53b2b945d56cd1a9b1bb92b5610b53 (diff)
downloadinfinitytier-536feb632ce13f460e4e0406f33664fb1253425d.tar.gz
infinitytier-536feb632ce13f460e4e0406f33664fb1253425d.zip
Support yet another old version of http-parser for CentOS/EPEL.
Diffstat (limited to 'service')
-rw-r--r--service/OneService.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp
index a5e49f36..39449cab 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -416,6 +416,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,
@@ -426,6 +428,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 TcpConnection
{