Changeset 13957 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 7, 2008 12:52:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/tcp_timer.c
r13783 r13957 46 46 register struct socket *so; 47 47 register struct tcpcb *tp; 48 #ifdef VBOX_WITH_SYNC_SLIRP49 struct socket *so_next;50 #endif51 48 52 49 DEBUG_CALL("tcp_fasttimo"); … … 56 53 #ifndef VBOX_WITH_SYNC_SLIRP 57 54 if (so) 58 for (; so != &tcb; so = so->so_next) { 59 #else 60 while(1) { 61 if ( so == &tcb) { 62 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 63 break; 64 } 65 so_next = so->so_next; 66 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 67 #endif 55 for (; so != &tcb; so = so->so_next) 68 56 if ((tp = (struct tcpcb *)so->so_tcpcb) && 69 57 (tp->t_flags & TF_DELACK)) { … … 73 61 (void) tcp_output(pData, tp); 74 62 } 75 VBOX_SLIRP_LOCK(pData->tcb_mutex); 76 #ifdef VBOX_WITH_SYNC_SLIRP 77 so = so_next; 78 #endif 63 #else /* VBOX_WITH_SYNC_SLIRP */ 64 while(1) 65 { 66 struct socket *so_next; 67 if (so == &tcb || so == NULL) 68 { 69 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 70 break; 71 } 72 so_next = so->so_next; 73 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 74 if ( (tp = (struct tcpcb *)so->so_tcpcb) 75 && (tp->t_flags & TF_DELACK)) 76 { 77 tp->t_flags &= ~TF_DELACK; 78 tp->t_flags |= TF_ACKNOW; 79 tcpstat.tcps_delack++; 80 (void) tcp_output(pData, tp); 81 } 82 VBOX_SLIRP_LOCK(pData->tcb_mutex); 83 so = so_next; 79 84 } 80 85 #endif /* VBOX_WITH_SYNC_SLIRP */ 81 86 } 82 87 … … 98 103 * Search through tcb's and update active timers. 99 104 */ 100 VBOX_SLIRP_LOCK(pData->tcb_mutex); 105 #ifndef VBOX_WITH_SYNC_SLIRP 101 106 ip = tcb.so_next; 102 #ifndef VBOX_WITH_SYNC_SLIRP103 107 if (ip == 0) 104 108 return; 105 109 for (; ip != &tcb; ip = ipnxt) { 106 #else107 if (ip == NULL) {108 VBOX_SLIRP_UNLOCK(pData->tcb_mutex);109 return;110 }111 while (1) {112 if (ip == &tcb) {113 VBOX_SLIRP_UNLOCK(pData->tcb_mutex);114 break;115 }116 ipnxt = ip->so_next;117 VBOX_SLIRP_UNLOCK(pData->tcb_mutex);118 #endif119 110 ipnxt = ip->so_next; 120 111 tp = sototcpcb(ip); 121 112 if (tp == 0) 122 goto before_loop_ends; /*vvl:the same as continue in original code*/113 continue; 123 114 for (i = 0; i < TCPT_NTIMERS; i++) { 124 115 if (tp->t_timer[i] && --tp->t_timer[i] == 0) { … … 133 124 tpgone: 134 125 ; 135 before_loop_ends:136 VBOX_SLIRP_LOCK(pData->tcb_mutex);137 #ifdef VBOX_WITH_SYNC_SLIRP138 ip=ipnxt;139 #endif140 126 } 141 tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */ 127 #else /* VBOX_WITH_SYNC_SLIRP */ 128 VBOX_SLIRP_LOCK(pData->tcb_mutex); 129 ip = tcb.so_next; 130 if (ip == NULL) 131 { 132 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 133 return; 134 } 135 while (1) 136 { 137 if (ip == &tcb) 138 { 139 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 140 break; 141 } 142 ipnxt = ip->so_next; 143 VBOX_SLIRP_UNLOCK(pData->tcb_mutex); 144 ipnxt = ip->so_next; 145 tp = sototcpcb(ip); 146 if (tp == 0) 147 goto tpgone; 148 for (i = 0; i < TCPT_NTIMERS; i++) 149 { 150 if (tp->t_timer[i] && --tp->t_timer[i] == 0) 151 { 152 tcp_timers(pData, tp,i); 153 if (ipnxt->so_prev != ip) 154 goto tpgone; 155 } 156 } 157 tp->t_idle++; 158 if (tp->t_rtt) 159 tp->t_rtt++; 160 tpgone: 161 VBOX_SLIRP_LOCK(pData->tcb_mutex); 162 ip = ipnxt; 163 } 164 #endif /* VBOX_WITH_SYNC_SLIRP */ 165 166 tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */ 142 167 #ifdef TCP_COMPAT_42 143 168 if ((int)tcp_iss < 0)
Note:
See TracChangeset
for help on using the changeset viewer.