diff options
| author | Grant Limberg <glimberg@gmail.com> | 2015-07-28 19:18:33 -0700 | 
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2015-07-28 19:18:33 -0700 | 
| commit | 508d31513a0848236258542930cf577d95afda99 (patch) | |
| tree | 453b31d874e6ec0dee3105191142efc8a326a30d /osdep/Phy.hpp | |
| parent | bc0954381ccdca065987512a45d5dd6ace6cca9d (diff) | |
| parent | 7578b5629849f6c286c353dce713b0816b1cc4a9 (diff) | |
| download | infinitytier-508d31513a0848236258542930cf577d95afda99.tar.gz infinitytier-508d31513a0848236258542930cf577d95afda99.zip | |
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'osdep/Phy.hpp')
| -rw-r--r-- | osdep/Phy.hpp | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/osdep/Phy.hpp b/osdep/Phy.hpp index ec01625b..2ea68b9d 100644 --- a/osdep/Phy.hpp +++ b/osdep/Phy.hpp @@ -144,7 +144,7 @@ private:  	fd_set _readfds;  	fd_set _writefds;  #if defined(_WIN32) || defined(_WIN64) -	fd_set _exceptfds;	 +	fd_set _exceptfds;  #endif  	long _nfds; @@ -152,13 +152,15 @@ private:  	ZT_PHY_SOCKFD_TYPE _whackSendSocket;  	bool _noDelay; +	bool _noCheck;  public:  	/**  	 * @param handler Pointer of type HANDLER_PTR_TYPE to handler  	 * @param noDelay If true, disable TCP NAGLE algorithm on TCP sockets +	 * @param noCheck If true, attempt to set UDP SO_NO_CHECK option to disable sending checksums  	 */ -	Phy(HANDLER_PTR_TYPE handler,bool noDelay) : +	Phy(HANDLER_PTR_TYPE handler,bool noDelay,bool noCheck) :  		_handler(handler)  	{  		FD_ZERO(&_readfds); @@ -202,6 +204,7 @@ public:  		_whackReceiveSocket = pipes[0];  		_whackSendSocket = pipes[1];  		_noDelay = noDelay; +		_noCheck = noCheck;  	}  	~Phy() @@ -297,6 +300,11 @@ public:  #ifdef IP_MTU_DISCOVER  			f = 0; setsockopt(s,IPPROTO_IP,IP_MTU_DISCOVER,&f,sizeof(f));  #endif +#ifdef SO_NO_CHECK +			if (_noCheck) { +				f = 1; setsockopt(s,SOL_SOCKET,SO_NO_CHECK,(void *)&f,sizeof(f)); +			} +#endif  		}  #endif // Windows or not @@ -773,7 +781,7 @@ public:  		// Causes entry to be deleted from list in poll(), ignored elsewhere  		sws.type = ZT_PHY_SOCKET_CLOSED; -		if (sws.sock >= _nfds) { +		if ((long)sws.sock >= (long)_nfds) {  			long nfds = (long)_whackSendSocket;  			if ((long)_whackReceiveSocket > nfds)  				nfds = (long)_whackReceiveSocket; | 
