Fix CI. Http parsing optimisation.
This commit is contained in:
parent
5b2b92835e
commit
4624155351
@ -13,17 +13,11 @@
|
||||
#include "Socket.h"
|
||||
#include "Sendable.h"
|
||||
|
||||
#ifdef ENABLE_TESTING
|
||||
#include <gtest/gtest.h>
|
||||
#endif
|
||||
|
||||
namespace fr
|
||||
{
|
||||
class Http : public Sendable
|
||||
{
|
||||
#ifdef ENABLE_TESTING
|
||||
FRIEND_TEST(HttpTest, test_string_split);
|
||||
#endif
|
||||
friend class HttpTest_test_string_split_Test;
|
||||
public:
|
||||
enum class RequestVersion
|
||||
{
|
||||
|
||||
@ -121,7 +121,7 @@ namespace fr
|
||||
private:
|
||||
mutable std::string payload;
|
||||
Opcode opcode;
|
||||
bool final;
|
||||
uint8_t final;
|
||||
static uint32_t current_mask_key;
|
||||
};
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ namespace fr
|
||||
|
||||
fr::Socket::Status HttpRequest::parse(const char *request, size_t requestsz)
|
||||
{
|
||||
body += std::string(request, requestsz);
|
||||
body.append(request, requestsz);
|
||||
|
||||
//Ensure that the whole header has been parsed first
|
||||
if(!header_ended)
|
||||
@ -182,8 +182,7 @@ namespace fr
|
||||
auto post = parse_argument_list(body.substr(post_begin, body.size() - post_begin - (body.size() - post_end)));
|
||||
for(auto &c : post)
|
||||
{
|
||||
std::transform(c.first.begin(), c.first.end(), c.first.begin(), ::tolower);
|
||||
post_data.emplace(std::move(c.first), std::move(c.second));
|
||||
this->post(std::move(c.first)) = std::move(c.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ namespace fr
|
||||
{
|
||||
fr::Socket::Status HttpResponse::parse(const char *response_data, size_t datasz)
|
||||
{
|
||||
body += std::string(response_data, datasz);
|
||||
body.append(response_data, datasz);
|
||||
|
||||
//Ensure that the whole header has been parsed first
|
||||
if(!header_ended)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user