Changeset 38111 in vbox
- Timestamp:
- Jul 22, 2011 6:05:36 AM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r37596 r38111 298 298 STAM_PROFILE_START(&pThis->StatNATRecv, a); 299 299 300 STAM_PROFILE_START(&pThis->StatNATRecvWait, b);301 300 302 301 while (ASMAtomicReadU32(&pThis->cUrgPkts) != 0) … … 312 311 AssertRC(rc); 313 312 313 STAM_PROFILE_START(&pThis->StatNATRecvWait, b); 314 314 rc = pThis->pIAboveNet->pfnWaitReceiveAvail(pThis->pIAboveNet, RT_INDEFINITE_WAIT); 315 STAM_PROFILE_STOP(&pThis->StatNATRecvWait, b); 316 315 317 if (RT_SUCCESS(rc)) 316 318 { … … 333 335 drvNATNotifyNATThread(pThis, "drvNATRecvWorker"); 334 336 335 STAM_PROFILE_STOP(&pThis->StatNATRecvWait, b);336 337 STAM_PROFILE_STOP(&pThis->StatNATRecv, a); 337 338 } … … 1156 1157 "\0NextServer\0DNSProxy\0BindIP\0UseHostResolver\0" 1157 1158 "SlirpMTU\0AliasMode\0" 1158 "SockRcv\0SockSnd\0TcpRcv\0TcpSnd\0")) 1159 "SockRcv\0SockSnd\0TcpRcv\0TcpSnd\0" 1160 "SoMaxConnection\0")) 1159 1161 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, 1160 1162 N_("Unknown NAT configuration option, only supports PassDomain," … … 1213 1215 i32AliasMode |= (i32MainAliasMode & 0x2 ? 0x40 : 0); 1214 1216 i32AliasMode |= (i32MainAliasMode & 0x4 ? 0x4 : 0); 1217 int i32SoMaxConn = 1; 1218 GET_S32(rc, pThis, pCfg, "SoMaxConnection", i32SoMaxConn); 1215 1219 /* 1216 1220 * Query the network port interface. … … 1255 1259 slirp_set_dhcp_dns_proxy(pThis->pNATState, !!fDNSProxy); 1256 1260 slirp_set_mtu(pThis->pNATState, MTU); 1261 slirp_set_somaxconn(pThis->pNATState, i32SoMaxConn); 1257 1262 char *pszBindIP = NULL; 1258 1263 GET_STRING_ALLOC(rc, pThis, pCfg, "BindIP", pszBindIP); -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r35922 r38111 95 95 void slirp_set_mtu(PNATState, int); 96 96 void slirp_info(PNATState pData, PCDBGFINFOHLP pHlp, const char *pszArgs); 97 void slirp_set_somaxconn(PNATState pData, int iSoMaxConn); 97 98 98 99 #if defined(RT_OS_WINDOWS) -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r38110 r38111 606 606 tcp_sndspace = 64 * _1K; 607 607 tcp_rcvspace = 64 * _1K; 608 pData->soMaxConn = 1; /* historical value */ 608 609 609 610 #ifdef RT_OS_WINDOWS … … 2002 2003 } while (0) 2003 2004 2005 void slirp_set_somaxconn(PNATState pData, int iSoMaxConn) 2006 { 2007 LogFlowFunc(("iSoMaxConn:d\n", iSoMaxConn)); 2008 if (iSoMaxConn > SOMAXCONN) 2009 { 2010 LogRel(("New value of somaxconn(%d) bigger than SOMAXCONN(%d)\n", iSoMaxConn, SOMAXCONN)); 2011 pData->soMaxConn = SOMAXCONN; 2012 } 2013 pData->soMaxConn = iSoMaxConn > 0 ? iSoMaxConn : pData->soMaxConn; 2014 LogRel(("New value of somaxconn: %d\n", pData->soMaxConn)); 2015 LogFlowFuncLeave(); 2016 } 2004 2017 /* don't allow user set less 8kB and more than 1M values */ 2005 2018 #define _8K_1M_CHECK_ARG(name, val) CHECK_ARG(name, (val), 8, 1024) -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r36216 r38111 134 134 int socket_rcv; 135 135 int socket_snd; 136 int soMaxConn; 136 137 #ifdef VBOX_WITH_SLIRP_MT 137 138 PRTREQQUEUE pReqQueue; -
trunk/src/VBox/Devices/Network/slirp/socket.c
r38108 r38111 1025 1025 || (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,(char *)&opt, sizeof(int)) < 0) 1026 1026 || (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) 1027 || (listen(s, SOMAXCONN) < 0))1027 || (listen(s, pData->soMaxConn) < 0)) 1028 1028 { 1029 1029 #ifdef RT_OS_WINDOWS
Note:
See TracChangeset
for help on using the changeset viewer.