Loading src/connection.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -171,9 +171,10 @@ netplus::con::condata *netplus::con::_resizeQueue(condata** firstdata, condata** qsize-=size; int curlen =0; HAVEDATA: if((*firstdata)) { int curlen = ((int)(*firstdata)->getDataLength() - size); curlen += ((int)(*firstdata)->getDataLength() - size); if ( curlen <= 0 || size >= curlen) { size -= (*firstdata)->getDataLength(); Loading Loading @@ -201,10 +202,10 @@ HAVEDATA: goto HAVEDATA; #ifdef DEBUG std::cout << " delsize: " << delsize << ": " << size << " Calculated Blocksize: " << (presize-delsize) << " Planned size: " << qsize << std::endl; // std::cout << " delsize: " << delsize << ": " << size // << " Calculated Blocksize: " << (presize-delsize) // << " Planned size: " << qsize // << std::endl; if((presize-delsize)!=qsize){ exception[NetException::Critical] << "_resizeQueue: Calculated wrong size"; throw exception; Loading src/linux/event.cpp +9 −16 Original line number Diff line number Diff line Loading @@ -160,11 +160,8 @@ namespace netplus { try { char buf[BLOCKSIZE]; ssize_t rcvsize = _ServerSocket->recvData(rcon->csock, buf, BLOCKSIZE); if (rcvsize <= 0) { NetException exp; exp[NetException::Error] << "ReadEvent: recvData failed at pos: " << pos; throw exp; } if(rcvsize==0) return; rcon->addRecvQueue(buf, rcvsize); RequestEvent(rcon); } Loading @@ -190,12 +187,6 @@ namespace netplus { (void*)wcon->getSendData()->getData(), wcon->getSendData()->getDataLength(), 0); if (sended < 0) { NetException exp; exp[NetException::Error] << "WriteEvent: sendData failed at pos: " << pos; throw exp; } if(sended!=0) wcon->resizeSendQueue(sended); ResponseEvent(wcon); Loading @@ -214,6 +205,7 @@ namespace netplus { if(!delcon) return; if(delcon->csock){ int ect = epoll_ctl(_pollFD, EPOLL_CTL_DEL, delcon->csock->getSocket(), 0); Loading @@ -221,6 +213,7 @@ namespace netplus { except[NetException::Error] << "CloseEvent can't delete Connection from epoll"; throw except; } } DisconnectEvent(delcon); Loading Loading
src/connection.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -171,9 +171,10 @@ netplus::con::condata *netplus::con::_resizeQueue(condata** firstdata, condata** qsize-=size; int curlen =0; HAVEDATA: if((*firstdata)) { int curlen = ((int)(*firstdata)->getDataLength() - size); curlen += ((int)(*firstdata)->getDataLength() - size); if ( curlen <= 0 || size >= curlen) { size -= (*firstdata)->getDataLength(); Loading Loading @@ -201,10 +202,10 @@ HAVEDATA: goto HAVEDATA; #ifdef DEBUG std::cout << " delsize: " << delsize << ": " << size << " Calculated Blocksize: " << (presize-delsize) << " Planned size: " << qsize << std::endl; // std::cout << " delsize: " << delsize << ": " << size // << " Calculated Blocksize: " << (presize-delsize) // << " Planned size: " << qsize // << std::endl; if((presize-delsize)!=qsize){ exception[NetException::Critical] << "_resizeQueue: Calculated wrong size"; throw exception; Loading
src/linux/event.cpp +9 −16 Original line number Diff line number Diff line Loading @@ -160,11 +160,8 @@ namespace netplus { try { char buf[BLOCKSIZE]; ssize_t rcvsize = _ServerSocket->recvData(rcon->csock, buf, BLOCKSIZE); if (rcvsize <= 0) { NetException exp; exp[NetException::Error] << "ReadEvent: recvData failed at pos: " << pos; throw exp; } if(rcvsize==0) return; rcon->addRecvQueue(buf, rcvsize); RequestEvent(rcon); } Loading @@ -190,12 +187,6 @@ namespace netplus { (void*)wcon->getSendData()->getData(), wcon->getSendData()->getDataLength(), 0); if (sended < 0) { NetException exp; exp[NetException::Error] << "WriteEvent: sendData failed at pos: " << pos; throw exp; } if(sended!=0) wcon->resizeSendQueue(sended); ResponseEvent(wcon); Loading @@ -214,6 +205,7 @@ namespace netplus { if(!delcon) return; if(delcon->csock){ int ect = epoll_ctl(_pollFD, EPOLL_CTL_DEL, delcon->csock->getSocket(), 0); Loading @@ -221,6 +213,7 @@ namespace netplus { except[NetException::Error] << "CloseEvent can't delete Connection from epoll"; throw except; } } DisconnectEvent(delcon); Loading