Loading src/connection.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -49,16 +49,14 @@ */ netplus::condata<char>::condata() : vector(){ pos=0; } netplus::condata<char>::condata(const condata<char> &src) : vector(src) { pos=0; } netplus::condata<char>::condata(const std::vector<char> &src){ pos=0; std::copy(src.begin(),src.end(),std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); this->reserve(this->size() + src.size()); this->insert(this->end(), src.data(), src.data() + src.size()); } netplus::condata<char>::iterator netplus::condata<char>::begin(){ Loading @@ -81,11 +79,8 @@ void netplus::condata<char>::append(const char* data, size_t datalen){ if (!data || datalen == 0) return; // Use reserve to prevent multiple reallocations and // catch allocation errors early this->reserve(this->size() + datalen); // Standard insert is generally faster and safer than back_inserter for raw arrays this->insert(this->end(), data, data + datalen); } Loading src/connection.h +0 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,6 @@ namespace netplus { void append(const char *data,size_t datalen); size_t search(const char *word); size_t search(const char *word,size_t pos); size_t pos; }; class con { Loading src/event/epoll.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ namespace netplus { }; void ConnectEventHandler(int pos, const int tid, ULONG_PTR args) { if (!event::Running) return; NetException exception; std::shared_ptr<con> ccon; Loading @@ -183,7 +186,7 @@ namespace netplus { } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK, 1); ccon->csock->setNonBlock(); // 3) Bridge to shared_ptr ccon->lasteventime = time(nullptr); Loading src/eventapi.h +2 −2 File changed.Contains only whitespace changes. Show changes Loading
src/connection.cpp +2 −7 Original line number Diff line number Diff line Loading @@ -49,16 +49,14 @@ */ netplus::condata<char>::condata() : vector(){ pos=0; } netplus::condata<char>::condata(const condata<char> &src) : vector(src) { pos=0; } netplus::condata<char>::condata(const std::vector<char> &src){ pos=0; std::copy(src.begin(),src.end(),std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); this->reserve(this->size() + src.size()); this->insert(this->end(), src.data(), src.data() + src.size()); } netplus::condata<char>::iterator netplus::condata<char>::begin(){ Loading @@ -81,11 +79,8 @@ void netplus::condata<char>::append(const char* data, size_t datalen){ if (!data || datalen == 0) return; // Use reserve to prevent multiple reallocations and // catch allocation errors early this->reserve(this->size() + datalen); // Standard insert is generally faster and safer than back_inserter for raw arrays this->insert(this->end(), data, data + datalen); } Loading
src/connection.h +0 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,6 @@ namespace netplus { void append(const char *data,size_t datalen); size_t search(const char *word); size_t search(const char *word,size_t pos); size_t pos; }; class con { Loading
src/event/epoll.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ namespace netplus { }; void ConnectEventHandler(int pos, const int tid, ULONG_PTR args) { if (!event::Running) return; NetException exception; std::shared_ptr<con> ccon; Loading @@ -183,7 +186,7 @@ namespace netplus { } _ServerSocket->accept(ccon->csock); ccon->csock->setFlag(O_NONBLOCK, 1); ccon->csock->setNonBlock(); // 3) Bridge to shared_ptr ccon->lasteventime = time(nullptr); Loading