Commit 5eaf775d authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Fix broken _convert_sockopt for IPPROTO_TCP cases, added TCP_NODELAY.

parent 2503e7e4
......@@ -220,6 +220,9 @@ typedef struct WSAData {
#define WS_IOR(x,y,t) (WS_IOC_OUT|(((UINT)sizeof(t)&WS_IOCPARM_MASK)<<16)|((x)<<8)|(y))
#define WS_IOW(x,y,t) (WS_IOC_IN|(((UINT)sizeof(t)&WS_IOCPARM_MASK)<<16)|((x)<<8)|(y))
/* IPPROTO_TCP options */
#define WS_TCP_NODELAY 1 /* do not apply nagle algorithm */
/*
* Socket I/O flags (supported by spec 1.1)
*/
......
......@@ -98,6 +98,20 @@ static int _px_sock_ops[] =
SO_LINGER, SO_OOBINLINE, SO_SNDBUF, SO_RCVBUF, SO_ERROR, SO_TYPE,
SO_LINGER };
static INT _ws_tcp_ops[] = {
#ifdef TCP_NODELAY
WS_TCP_NODELAY,
#endif
0
};
static int _px_tcp_ops[] = {
#ifdef TCP_NODELAY
TCP_NODELAY,
#endif
0
};
static int _check_ws(LPWSINFO pwsi, ws_socket* pws);
static char* _check_buffer(LPWSINFO pwsi, int size);
......@@ -116,10 +130,15 @@ static void convert_sockopt(INT *level, INT *optname)
for(i=0; _ws_sock_ops[i]; i++)
if( _ws_sock_ops[i] == *optname ) break;
if( _ws_sock_ops[i] ) *optname = _px_sock_ops[i];
else WARN(winsock, "Unknown optname %d\n", *optname);
else FIXME(winsock, "Unknown SOL_SOCKET optname %d\n", *optname);
break;
case WS_IPPROTO_TCP:
*optname = IPPROTO_TCP;
*level = IPPROTO_TCP;
for(i=0; _ws_tcp_ops[i]; i++)
if ( _ws_tcp_ops[i] == *optname ) break;
if( _ws_tcp_ops[i] ) *optname = _px_tcp_ops[i];
else FIXME(winsock, "Unknown IPPROTO_TCP optname %d\n", *optname);
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment