Ignore SIGPIPE, the return code of a nonblocking connect() is EINPROGRESS, not EWOULDBLOCK.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2125 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ca278f79e0
commit
7839d35975
1 changed files with 10 additions and 1 deletions
|
@ -18,6 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include "qtv.h"
|
||||
|
||||
#define RECONNECT_TIME (1000*30)
|
||||
|
@ -238,7 +242,7 @@ qboolean Net_ConnectToTCPServer(sv_t *qtv, char *ip)
|
|||
|
||||
if (connect(qtv->sourcesock, (struct sockaddr *)&qtv->serveraddress, sizeof(qtv->serveraddress)) == INVALID_SOCKET)
|
||||
{
|
||||
if (qerrno != EWOULDBLOCK)
|
||||
if (qerrno != EINPROGRESS)
|
||||
{
|
||||
closesocket(qtv->sourcesock);
|
||||
qtv->sourcesock = INVALID_SOCKET;
|
||||
|
@ -427,6 +431,7 @@ void Net_TryFlushProxyBuffer(cluster_t *cluster, oproxy_t *prox)
|
|||
char *buffer;
|
||||
int length;
|
||||
int bufpos;
|
||||
fd_set wfds;
|
||||
|
||||
while (prox->bufferpos >= MAX_PROXY_BUFFER)
|
||||
{ //so we never get any issues with wrapping..
|
||||
|
@ -1777,6 +1782,10 @@ int main(int argc, char **argv)
|
|||
{
|
||||
cluster_t cluster;
|
||||
|
||||
#ifndef _WIN32
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
WSADATA discard;
|
||||
|
|
Loading…
Reference in a new issue