VirtualBox

Changeset 20172 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jun 2, 2009 2:40:55 AM (16 years ago)
Author:
vboxsync
Message:

NAT: redability (part2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r20171 r20172  
    964964            {
    965965#ifdef VBOX_WITH_SLIRP_DNS_PROXY
    966                     Log2(("NAT: %R[natsock] expired\n", so));
    967                     if (so->so_timeout != NULL)
    968                     {
    969                         so->so_timeout(pData, so, so->so_timeout_arg);
    970                     }
     966                Log2(("NAT: %R[natsock] expired\n", so));
     967                if (so->so_timeout != NULL)
     968                {
     969                    so->so_timeout(pData, so, so->so_timeout_arg);
     970                }
    971971#endif
    972972#ifdef VBOX_WITH_SLIRP_MT
    973973                    /* we need so_next for continue our cycle*/
    974                     so_next = so->so_next;
    975 #endif
    976                     UDP_DETACH(pData, so, so_next);
    977                     CONTINUE_NO_UNLOCK(udp);
    978                 }
    979                 else
    980                     do_slowtimo = 1; /* Let socket expire */
    981             }
    982 
    983             /*
    984              * When UDP packets are received from over the link, they're
    985              * sendto()'d straight away, so no need for setting for writing
    986              * Limit the number of packets queued by this session to 4.
    987              * Note that even though we try and limit this to 4 packets,
    988              * the session could have more queued if the packets needed
    989              * to be fragmented.
    990              *
    991              * (XXX <= 4 ?)
    992              */
    993             if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4)
    994             {
    995                 STAM_COUNTER_INC(&pData->StatUDPHot);
    996                 UDP_ENGAGE_EVENT(so, readfds);
    997             }
    998             LOOP_LABEL(udp, so, so_next);
    999         }
    1000 
     974                so_next = so->so_next;
     975#endif
     976                UDP_DETACH(pData, so, so_next);
     977                CONTINUE_NO_UNLOCK(udp);
     978            }
     979            else
     980                do_slowtimo = 1; /* Let socket expire */
     981        }
     982   
     983        /*
     984         * When UDP packets are received from over the link, they're
     985         * sendto()'d straight away, so no need for setting for writing
     986         * Limit the number of packets queued by this session to 4.
     987         * Note that even though we try and limit this to 4 packets,
     988         * the session could have more queued if the packets needed
     989         * to be fragmented.
     990         *
     991         * (XXX <= 4 ?)
     992         */
     993        if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4)
     994        {
     995            STAM_COUNTER_INC(&pData->StatUDPHot);
     996            UDP_ENGAGE_EVENT(so, readfds);
     997        }
     998        LOOP_LABEL(udp, so, so_next);
    1001999    }
    10021000done:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette