1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 22:37:45 +00:00

A few bugfixes

This commit is contained in:
mordred 2018-10-26 11:01:41 +02:00
parent 4f41a6a8be
commit 0d3f9d77bf
3 changed files with 9 additions and 9 deletions

View file

@ -4,7 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
#include <memory>
#include "PlayerMinimal.h" #include "PlayerMinimal.h"
namespace Core { namespace Core {

View file

@ -94,7 +94,7 @@ namespace SimpleWeb {
std::unordered_multimap<std::string, std::string, case_insensitive_hash, case_insensitive_equals> header; std::unordered_multimap<std::string, std::string, case_insensitive_hash, case_insensitive_equals> header;
REGEX_NS::smatch path_match; std::smatch path_match;
std::string remote_endpoint_address; std::string remote_endpoint_address;
unsigned short remote_endpoint_port; unsigned short remote_endpoint_port;
@ -134,11 +134,11 @@ namespace SimpleWeb {
Config config; Config config;
private: private:
class regex_orderable : public REGEX_NS::regex { class regex_orderable : public std::regex {
std::string str; std::string str;
public: public:
regex_orderable(const char *regex_cstr) : REGEX_NS::regex(regex_cstr), str(regex_cstr) {} regex_orderable(const char *regex_cstr) : std::regex(regex_cstr), str(regex_cstr) {}
regex_orderable(const std::string &regex_str) : REGEX_NS::regex(regex_str), str(regex_str) {} regex_orderable(const std::string &regex_str) : std::regex(regex_str), str(regex_str) {}
bool operator<(const regex_orderable &rhs) const { bool operator<(const regex_orderable &rhs) const {
return str<rhs.str; return str<rhs.str;
} }
@ -350,8 +350,8 @@ namespace SimpleWeb {
for(auto &regex_method: resource) { for(auto &regex_method: resource) {
auto it=regex_method.second.find(request->method); auto it=regex_method.second.find(request->method);
if(it!=regex_method.second.end()) { if(it!=regex_method.second.end()) {
REGEX_NS::smatch sm_res; std::smatch sm_res;
if(REGEX_NS::regex_match(request->path, sm_res, regex_method.first)) { if(std::regex_match(request->path, sm_res, regex_method.first)) {
request->path_match=std::move(sm_res); request->path_match=std::move(sm_res);
write_response(socket, request, it->second); write_response(socket, request, it->second);
return; return;
@ -388,7 +388,7 @@ namespace SimpleWeb {
auto range=request->header.equal_range("Connection"); auto range=request->header.equal_range("Connection");
for(auto it=range.first;it!=range.second;it++) { for(auto it=range.first;it!=range.second;it++) {
if( Core::Util::toLoweCopy( it->second ) == "close" ) if( Core::Util::toLowerCopy( it->second ) == "close" )
return; return;
} }
if(http_version>1.05) if(http_version>1.05)

View file

@ -9,7 +9,7 @@
#include <random> #include <random>
#include <mutex> #include <mutex>
#include <type_traits> #include <type_traits>
#include <hash> #include <functional>
class case_insensitive_equals { class case_insensitive_equals {
public: public: