Commit 05b0c71d authored by jan.koester's avatar jan.koester
Browse files

test

parent ba921fe8
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -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(){
@@ -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);
}

+0 −1
Original line number Diff line number Diff line
@@ -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 {
+4 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+2 −2

File changed.

Contains only whitespace changes.