Added some FIOBIO calls after select, apparently linux needs these (windows does not)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2636 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2007-09-04 20:54:24 +00:00
parent 06da06f9b3
commit afcf2e0ce8
5 changed files with 16 additions and 1 deletions

View File

@ -1426,10 +1426,12 @@ qboolean NET_GetPacket (netsrc_t netsrc)
if (newsock != INVALID_SOCKET)
{
int _true = true;
ioctlsocket(newsock, FIONBIO, &_true);
setsockopt(newsock, IPPROTO_TCP, TCP_NODELAY, (char *)&_true, sizeof(_true));
st = Z_Malloc(sizeof(svtcpstream_t));
st->waitingforprotocolconfirmation = true;
st->next = svs.tcpstreams;

View File

@ -377,6 +377,7 @@ iwboolean FTP_ClientConnThink (FTPclientconn_t *con) //true to kill con
if (temp != INVALID_SOCKET)
{
ioctlsocket(temp, FIONBIO, &_true);
con->stage = 6;
if (con->type == ftp_getting)
{

View File

@ -506,6 +506,7 @@ iwboolean FTP_ServerThinkForConnection(FTPclient_t *cl)
}
if (cl->dataislisten) //accept a connect.
{
int _true = true;
int temp;
struct sockaddr_in adr;
int adrlen = sizeof(adr);
@ -519,6 +520,8 @@ iwboolean FTP_ServerThinkForConnection(FTPclient_t *cl)
QueueMessageva (cl, "425 Your client connected too slowly - %i.\r\n", qerrno);
continue;
}
else
ioctlsocket(cl->datasock, FIONBIO, &_true);
}
if (cl->datasock == INVALID_SOCKET)
{
@ -571,6 +574,8 @@ iwboolean FTP_ServerThinkForConnection(FTPclient_t *cl)
QueueMessageva (cl, "425 Your client connected too slowly - %i.\r\n", qerrno);
continue;
}
else
ioctlsocket(cl->datasock, FIONBIO, &_true);
}
if (cl->datasock == INVALID_SOCKET)
{
@ -647,6 +652,8 @@ iwboolean FTP_ServerThinkForConnection(FTPclient_t *cl)
QueueMessageva (cl, "425 Your client connected too slowly - %i.\r\n", qerrno);
continue;
}
else
ioctlsocket(cl->datasock, FIONBIO, &_true);
}
if (cl->datasock == INVALID_SOCKET)
{
@ -815,7 +822,6 @@ unsigned long _true = true;
return false;
}
//is this needed?
if (ioctlsocket (clientsock, FIONBIO, &_true) == -1)
{
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(qerrno));

View File

@ -482,6 +482,7 @@ qboolean HTTP_ServerPoll(qboolean httpserverwanted) //loop while true
struct sockaddr_in from;
int fromlen;
int clientsock;
int _true = true;
HTTP_active_connections_t *cl;
@ -522,6 +523,8 @@ qboolean HTTP_ServerPoll(qboolean httpserverwanted) //loop while true
return false;
}
ioctlsocket(clientsock, FIONBIO, &_true);
cl = IWebMalloc(sizeof(HTTP_active_connections_t));
cl->datasock = clientsock;

View File

@ -2372,6 +2372,7 @@ void SV_MVDStream_Poll(void)
{
static int listensocket=INVALID_SOCKET;
static int listenport;
int _true = true;
int client;
netadr_t na;
@ -2420,6 +2421,8 @@ void SV_MVDStream_Poll(void)
if (client == INVALID_SOCKET)
return;
ioctlsocket(client, FIONBIO, &_true);
if (qtv_maxstreams.value > 0)
{
count = 0;