From f9dcedb0e1f72e474995e63bd06cc822fd195ec7 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 31 Oct 2011 19:48:29 +0100 Subject: [PATCH] Re-fix for HTTP lib, fixed typo in Controller. --- util/http_parser.cpp | 5 ++--- util/http_parser.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/util/http_parser.cpp b/util/http_parser.cpp index 2e7f7239..d2b2ac89 100644 --- a/util/http_parser.cpp +++ b/util/http_parser.cpp @@ -158,8 +158,7 @@ bool HTTP::Parser::parse(){ f = tmpA.find(' '); if (f != std::string::npos){protocol = tmpA.substr(0, f); tmpA.erase(0, f+1);} if (url.find('?') != std::string::npos){ - std::string queryvars = url.substr(url.find('?')+1); - parseVars(queryvars); //parse GET variables + parseVars(url.substr(url.find('?')+1)); //parse GET variables } }else{ if (tmpA.size() == 0){ @@ -204,7 +203,7 @@ void HTTP::Parser::SendResponse(Socket::Connection & conn, std::string code, std /// Parses GET or POST-style variable data. /// Saves to internal variable structure using HTTP::Parser::SetVar. -void HTTP::Parser::parseVars(std::string & data){ +void HTTP::Parser::parseVars(std::string data){ std::string varname; std::string varval; while (data.find('=') != std::string::npos){ diff --git a/util/http_parser.h b/util/http_parser.h index 6172ac00..124b9686 100644 --- a/util/http_parser.h +++ b/util/http_parser.h @@ -41,7 +41,7 @@ namespace HTTP{ bool seenHeaders; bool seenReq; bool parse(); - void parseVars(std::string & data); + void parseVars(std::string data); std::string HTTPbuffer; std::map headers; std::map vars;