Loading src/connection.cpp +3 −7 Original line number Diff line number Diff line Loading @@ -55,8 +55,7 @@ netplus::condata<char>::condata(const condata<char> &src) : vector(src) { } netplus::condata<char>::condata(const std::vector<char> &src){ this->reserve(this->size() + src.size()); this->insert(this->end(), src.data(), src.data() + src.size()); std::copy(src.begin(),src.end(),std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } netplus::condata<char>::iterator netplus::condata<char>::begin(){ Loading @@ -76,12 +75,9 @@ netplus::condata<char>::const_iterator netplus::condata<char>::end() const{ } void netplus::condata<char>::append(const char* data, size_t datalen){ if (!data || datalen == 0) if ( !data || data == data + datalen) return; this->reserve(this->size() + datalen); this->insert(this->end(), data, data + datalen); std::copy(data,data+datalen,std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } size_t netplus::condata<char>::search(const char* word,size_t pos){ Loading src/connection.h +3 −0 Original line number Diff line number Diff line Loading @@ -166,8 +166,11 @@ namespace netplus { condata<char> RecvData; condata<char> SendData; size_t pos=0; /*states*/ size_t SendOff = 0; std::atomic_bool WritePending{ false }; int DebugId=0; Loading src/event/epoll.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -166,9 +166,6 @@ namespace netplus { }; void ConnectEventHandler(int pos, const int tid, ULONG_PTR args) { if (!event::Running) return; NetException exception; std::shared_ptr<con> ccon; Loading @@ -186,7 +183,7 @@ namespace netplus { } _ServerSocket->accept(ccon->csock); ccon->csock->setNonBlock(); ccon->csock->setFlag(O_NONBLOCK, 1); // 3) Bridge to shared_ptr ccon->lasteventime = time(nullptr); Loading src/socket.h +1 −2 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ namespace netplus { buffer(size_t bsize) { data.buf = new char[bsize](); size = bsize; ptr = false; } buffer(const char* bptr, size_t bsize) { Loading @@ -129,7 +128,7 @@ namespace netplus { } size_t size; bool ptr; bool ptr = false; union { char* buf; const char* ptr; Loading src/posix/tcp.cpp +2 −2 File changed.Contains only whitespace changes. Show changes Loading
src/connection.cpp +3 −7 Original line number Diff line number Diff line Loading @@ -55,8 +55,7 @@ netplus::condata<char>::condata(const condata<char> &src) : vector(src) { } netplus::condata<char>::condata(const std::vector<char> &src){ this->reserve(this->size() + src.size()); this->insert(this->end(), src.data(), src.data() + src.size()); std::copy(src.begin(),src.end(),std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } netplus::condata<char>::iterator netplus::condata<char>::begin(){ Loading @@ -76,12 +75,9 @@ netplus::condata<char>::const_iterator netplus::condata<char>::end() const{ } void netplus::condata<char>::append(const char* data, size_t datalen){ if (!data || datalen == 0) if ( !data || data == data + datalen) return; this->reserve(this->size() + datalen); this->insert(this->end(), data, data + datalen); std::copy(data,data+datalen,std::back_inserter<std::vector<char,condataAlloc<char>>>(*this)); } size_t netplus::condata<char>::search(const char* word,size_t pos){ Loading
src/connection.h +3 −0 Original line number Diff line number Diff line Loading @@ -166,8 +166,11 @@ namespace netplus { condata<char> RecvData; condata<char> SendData; size_t pos=0; /*states*/ size_t SendOff = 0; std::atomic_bool WritePending{ false }; int DebugId=0; Loading
src/event/epoll.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -166,9 +166,6 @@ namespace netplus { }; void ConnectEventHandler(int pos, const int tid, ULONG_PTR args) { if (!event::Running) return; NetException exception; std::shared_ptr<con> ccon; Loading @@ -186,7 +183,7 @@ namespace netplus { } _ServerSocket->accept(ccon->csock); ccon->csock->setNonBlock(); ccon->csock->setFlag(O_NONBLOCK, 1); // 3) Bridge to shared_ptr ccon->lasteventime = time(nullptr); Loading
src/socket.h +1 −2 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ namespace netplus { buffer(size_t bsize) { data.buf = new char[bsize](); size = bsize; ptr = false; } buffer(const char* bptr, size_t bsize) { Loading @@ -129,7 +128,7 @@ namespace netplus { } size_t size; bool ptr; bool ptr = false; union { char* buf; const char* ptr; Loading