VirtualBox

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


Ignore:
Timestamp:
Nov 13, 2008 10:18:02 AM (16 years ago)
Author:
vboxsync
Message:

removing statics from slirp and using global pData instead

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
3 edited

Legend:

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

    r14163 r14165  
    226226    }
    227227#ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC
    228     /*XXX:probably should be configurable*/
    229228    pData->cMaxEvent = WSA_MAXIMUM_WAIT_EVENTS;
     229    pData->iCurrentEventIndex = 1; /* 0 - reserved for Sent event*/
     230    pData->iCurrentSocketIndex = 0;
    230231    pData->phEvents = malloc(sizeof(HANDLE) * pData->cMaxEvent);
    231232    for (i = 1; i < WSA_MAXIMUM_WAIT_EVENTS; ++i) {
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r14119 r14165  
    119119    int cMaxEvent;
    120120    HANDLE *phEvents;
     121    int iCurrentSocketIndex;
     122    int iCurrentEventIndex;
    121123#endif
    122124} NATState;
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r14159 r14165  
    739739void soregister_event(struct NATState *pData, struct socket *so)
    740740{
    741         static int soidx;
    742         static int eidx = 1;
    743741       
    744         if (soidx >= WSA_MAXIMUM_WAIT_EVENTS * eidx) {
    745                 eidx++;
    746         }
    747         so->hNetworkEvent = pData->phEvents[eidx];
    748         soidx++;
    749 }
    750 #endif
     742        if (pData->iCurrentSocketIndex >= WSA_MAXIMUM_WAIT_EVENTS * pData->iCurrentEventIndex) {
     743                pData->iCurrentEventIndex++;
     744        }
     745        so->hNetworkEvent = pData->phEvents[pData->iCurrentEventIndex];
     746        pData->iCurrentSocketIndex++;
     747}
     748#endif
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