Ignore:
Timestamp:
Mar 14, 2000, 3:59:43 PM (25 years ago)
Author:
sandervl
Message:

changed setsockopt bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/wsock32.cpp

    r3103 r3107  
    1 /* $Id: wsock32.cpp,v 1.18 2000-03-13 20:32:24 sandervl Exp $ */
     1/* $Id: wsock32.cpp,v 1.19 2000-03-14 14:59:43 sandervl Exp $ */
    22
    33/*
     
    4747#include <win32wnd.h>
    4848#include <stdlib.h>
     49#include <win32api.h>
    4950
    5051#include "wsock32.h"
     
    7071 * Prototypes                                                                *
    7172 *****************************************************************************/
    72 
    73 void __stdcall SetLastError(DWORD dwError);
    74 
    7573
    7674/*****************************************************************************
     
    735733        ULONG size;
    736734
    737         //SvL: Limit send & receive buffer length to 64k
    738         size = min(*(ULONG *)optval, 65000);
    739         rc = setsockopt(s,level,optname, (char *)&size,optlen);
     735        size = *(ULONG *)optval;
     736tryagain:
     737        rc = setsockopt(s,level,optname, (char *)&size, sizeof(ULONG));
     738        if(rc == SOCKET_ERROR && size > 65535) {
     739                //SvL: Limit send & receive buffer length to 64k
     740                //     (only happens with 16 bits tcpip stack?)
     741                size = 65000;
     742                goto tryagain;
     743        }
     744
    740745  }
    741746  else {
     
    13791384  HWND  hwndOS2 = Win32ToOS2Handle(hWnd);
    13801385  ULONG ulNewID;
     1386
     1387  dprintf(("WSAAsyncGetHostByName %s", name));
    13811388
    13821389  if (hwndRelay == NULL) // already initialized ?
Note: See TracChangeset for help on using the changeset viewer.