Skip to content

Commit

Permalink
update http web
Browse files Browse the repository at this point in the history
  • Loading branch information
cageq committed Jul 29, 2024
1 parent 8700508 commit 8bbe8ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Simple morden c++ network library wrapper based on asio standalone version, prov


## Build
need c++17 to compile it.
need c++17 to compile it.

It is a headonly library, basically you can copy all files to you project and use it.

Expand Down
10 changes: 3 additions & 7 deletions include/http/http_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ namespace knet
{

public:


HttpConnection(HttpRequestPtr req = nullptr) : first_request(req)
{

HttpConnection(HttpRequestPtr req = nullptr) : first_request(req) {
}

~HttpConnection() {}
Expand Down Expand Up @@ -86,10 +82,10 @@ namespace knet
return -1;
}

virtual bool handle_data(const std::string &msg)
virtual bool handle_data(char * data, uint32_t dataLen) override
{
auto req = std::make_shared<HttpRequest>();
auto msgLen = req->parse(msg.data(), msg.length());
auto msgLen = req->parse(data, dataLen);
if (msgLen > 0)
{
auto conn = this->shared_from_this();
Expand Down

0 comments on commit 8bbe8ed

Please sign in to comment.