X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_httpd.cpp;h=b768789f1cf0259d5cdd64dbd4a73a633d7daf28;hb=3450b3d1ccc1763d25a95315509ae3253fadcf89;hp=dadd2f257e68ccee3c3f7cbccb7819ce3821c1de;hpb=de7011e54ad88656e01c92a88dd053a94b5acc6b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index dadd2f257..b768789f1 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -28,14 +28,17 @@ #include "iohook.h" #include "modules/httpd.h" +#ifdef __GNUC__ +# pragma GCC diagnostic push +#endif + // 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,8 +46,17 @@ # endif #endif +// Fix warnings about shadowing in http_parser. +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wshadow" +#endif + #include +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + class ModuleHttpServer; static ModuleHttpServer* HttpModule; @@ -283,8 +295,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 +326,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))