diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-10 14:20:09 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-10 14:20:09 +0100 |
commit | 2aeb1606e5e90d087f0368409dd72709ba01b759 (patch) | |
tree | b4bfa3685a0d6d87429a2145002bfd6de665e490 /src | |
parent | 04004719c6d031dde96bb9d8927241eea0701f2f (diff) |
Fix some more warnings in the httpd module.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_httpd.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index dadd2f257..c4b5dc1f2 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -29,13 +29,12 @@ #include "modules/httpd.h" // Fix warnings about the use of commas at end of enumerator lists and long long -// on C++03 and warnings about shadowing in the http_parser library. +// on C++03. #if defined __clang__ # pragma clang diagnostic ignored "-Wc++11-extensions" # pragma clang diagnostic ignored "-Wc++11-long-long" #elif defined __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" -# pragma GCC diagnostic ignored "-Wshadow" # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) # pragma GCC diagnostic ignored "-Wpedantic" # else @@ -43,6 +42,11 @@ # endif #endif +// Fix warnings about shadowing in http_parser. +#ifdef __GNUC__ +//# pragma GCC diagnostic ignored "-Wshadow" +#endif + #include <http_parser.c> class ModuleHttpServer; @@ -283,8 +287,8 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru FIRST_MOD_RESULT_CUSTOM(*aclevprov, HTTPACLEventListener, OnHTTPACLCheck, MOD_RESULT, (acl)); if (MOD_RESULT != MOD_RES_DENY) { - HTTPRequest url(method, parsed, &headers, this, ip, body); - FIRST_MOD_RESULT_CUSTOM(*reqevprov, HTTPRequestEventListener, OnHTTPRequest, MOD_RESULT, (url)); + HTTPRequest request(method, parsed, &headers, this, ip, body); + FIRST_MOD_RESULT_CUSTOM(*reqevprov, HTTPRequestEventListener, OnHTTPRequest, MOD_RESULT, (request)); if (MOD_RESULT == MOD_RES_PASSTHRU) { SendHTTPError(404); @@ -314,10 +318,10 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru ServerInstance->GlobalCulls.AddItem(this); } - bool ParseURI(const std::string& uri, HTTPRequestURI& out) + bool ParseURI(const std::string& uristr, HTTPRequestURI& out) { http_parser_url_init(&url); - if (http_parser_parse_url(uri.c_str(), uri.size(), 0, &url) != 0) + if (http_parser_parse_url(uristr.c_str(), uristr.size(), 0, &url) != 0) return false; if (url.field_set & (1 << UF_PATH)) |