* Made the socket limit not be set in cygwin, which has bogus behavior. (bugreport:1684)
* Made the socket limit be set to the maximum allowed value when setting to FD_SETSIZE fails. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12839 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
0aaaac8314
commit
2fdf093539
@ -3,6 +3,9 @@ Date Added
|
|||||||
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
|
||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
|
2008/06/16
|
||||||
|
* Made the socket limit not be set in cygwin, which has bogus behavior. (bugreport:1684) [FlavioJS]
|
||||||
|
* Made the socket limit be set to the maximum allowed value when setting to FD_SETSIZE fails.
|
||||||
2008/06/14
|
2008/06/14
|
||||||
* Fixed Icewall not restoring the original cell type [ultramage]
|
* Fixed Icewall not restoring the original cell type [ultramage]
|
||||||
* Fixed PF_FOGWALL working on Boss monsters. [Brainstorm]
|
* Fixed PF_FOGWALL working on Boss monsters. [Brainstorm]
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#define MINGW
|
#define MINGW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(CYGWIN)
|
||||||
|
#define CYGWIN
|
||||||
|
#endif
|
||||||
|
|
||||||
// __APPLE__ is the only predefined macro on MacOS X
|
// __APPLE__ is the only predefined macro on MacOS X
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#define __DARWIN__
|
#define __DARWIN__
|
||||||
|
@ -1204,7 +1204,9 @@ void socket_init(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_SETRLIMIT)
|
#elif defined(HAVE_SETRLIMIT) && !defined(CYGWIN)
|
||||||
|
// NOTE: getrlimit and setrlimit have bogus behaviour in cygwin.
|
||||||
|
// "Number of fds is virtually unlimited in cygwin" (sys/param.h)
|
||||||
{// set socket limit to FD_SETSIZE
|
{// set socket limit to FD_SETSIZE
|
||||||
struct rlimit rlp;
|
struct rlimit rlp;
|
||||||
if( 0 == getrlimit(RLIMIT_NOFILE, &rlp) )
|
if( 0 == getrlimit(RLIMIT_NOFILE, &rlp) )
|
||||||
@ -1215,8 +1217,13 @@ void socket_init(void)
|
|||||||
rlp.rlim_max = FD_SETSIZE;
|
rlp.rlim_max = FD_SETSIZE;
|
||||||
if( 0 != setrlimit(RLIMIT_NOFILE, &rlp) )
|
if( 0 != setrlimit(RLIMIT_NOFILE, &rlp) )
|
||||||
{// failed
|
{// failed
|
||||||
|
// set to maximum allowed
|
||||||
getrlimit(RLIMIT_NOFILE, &rlp);
|
getrlimit(RLIMIT_NOFILE, &rlp);
|
||||||
ShowWarning("socket_init: %s - failed to set socket limit to %d (current limit %d).\n", strerror(errno), FD_SETSIZE, (int)rlp.rlim_cur);
|
rlp.rlim_cur = rlp.rlim_max;
|
||||||
|
setrlimit(RLIMIT_NOFILE, &rlp);
|
||||||
|
// report limit
|
||||||
|
getrlimit(RLIMIT_NOFILE, &rlp);
|
||||||
|
ShowWarning("socket_init: failed to set socket limit to %d (current limit %d).\n", FD_SETSIZE, (int)rlp.rlim_cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user