final fix for maxsockbuf issue

This commit is contained in:
snar
2011-06-14 16:34:43 +00:00
parent e27f13b9d2
commit c550350e4a

View File

@@ -69,7 +69,7 @@ sx_maxsockbuf(int s, int dir)
} else if(phase==1) {
phase=2; optval-=2048; continue;
} else break;
} else if(optval>=SX_MAXSOCKBUF_MAX) {
} else if((optval<<1)>=SX_MAXSOCKBUF_MAX) {
/* ... and getsockopt not failed and voptval>=optval. Do not allow
* to increase sockbuf too much even in case OS permits it */
break;