mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 07:59:35 -05:00
Merge pull request #2634 from csoler/v0.6-TorControl3
fixed bug in friendserver randomly dropping some incoming packets
This commit is contained in:
commit
c3c12a1a47
@ -26,6 +26,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
#include "util/rsnet.h"
|
||||
#include "util/rsprint.h"
|
||||
@ -45,6 +46,9 @@ FsNetworkInterface::FsNetworkInterface(const std::string& listening_address,uint
|
||||
mClintListn = 0;
|
||||
mClintListn = socket(AF_INET, SOCK_STREAM, 0); // creating socket
|
||||
|
||||
int flags=1;
|
||||
setsockopt(mClintListn,SOL_SOCKET,TCP_NODELAY,(char*)&flags,sizeof(flags));
|
||||
|
||||
unix_fcntl_nonblock(mClintListn);
|
||||
|
||||
struct sockaddr_in ipOfServer;
|
||||
@ -104,7 +108,7 @@ void FsNetworkInterface::threadTick()
|
||||
|
||||
RS_STACK_MUTEX(mFsNiMtx);
|
||||
for(auto& it:mConnections)
|
||||
if(it.second.bio->isactive())
|
||||
if(it.second.bio->isactive() || it.second.bio->moretoread(0))
|
||||
it.second.pqi_thread->tick();
|
||||
else
|
||||
to_close.push_back(it.first);
|
||||
@ -147,6 +151,9 @@ bool FsNetworkInterface::checkForNewConnections()
|
||||
|
||||
// Make the socket non blocking so that we can read from it and return if nothing comes
|
||||
|
||||
int flags=1;
|
||||
setsockopt(clintConnt,SOL_SOCKET,TCP_NODELAY,(char*)&flags,sizeof(flags));
|
||||
|
||||
unix_fcntl_nonblock(clintConnt);
|
||||
|
||||
// Create connection info
|
||||
|
Loading…
Reference in New Issue
Block a user