VirtualBox

Changeset 14085 in vbox


Ignore:
Timestamp:
Nov 11, 2008 11:46:20 AM (16 years ago)
Author:
vboxsync
Message:

loops for initialization/creation of event array was fixed but wasn't removed
event per socket initialization was fixed
UDP event range for WSASelect was increased (UDB works ) testted with DNS
similar thing should be done for TCP (in progress)

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

Legend:

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

    r14041 r14085  
    374374                 */
    375375                cElements = 1;
    376                 for (so = tcb.so_next; so != &tcb; so = so_next, cElements++)
    377                     ;
     376                for (so = tcb.so_next; so != &tcb; so = so_next, cElements++) 
     377                        so_next = so->so_next;
    378378                for (so = udb.so_next; so != &udb; so = so_next, cElements++)
    379                     ;
     379                        so_next = so->so_next;
    380380                if (pData->phEvents != NULL)
    381381                    free(pData->phEvents);
     
    497497                                UPD_NFDS(so->s);
    498498#else
    499                                 rc = WSAEventSelect(so->s, so->hNetworkEvent, FD_READ);
     499                                WSAResetEvent(so->hNetworkEvent);
     500                                rc = WSAEventSelect(so->s, so->hNetworkEvent, FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT);
    500501                                AssertRelease(rc != SOCKET_ERROR);
    501502                                pData->phEvents[cEvents] = so->hNetworkEvent;
     
    582583                for (so = tcb.so_next; so != &tcb; so = so_next) {
    583584                        so_next = so->so_next;
     585
     586                        /*
     587                         * FD_ISSET is meaningless on these sockets
     588                         * (and they can crash the program)
     589                         */
     590                        if (so->so_state & SS_NOFDREF || so->s == -1)
     591                           continue;
    584592#if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    585593                        rc = WSAEnumNetworkEvents(so->s, so->hNetworkEvent, &NetworkEvents);   
    586594                        AssertRelease(rc != SOCKET_ERROR);
    587595#endif
    588 
    589                         /*
    590                          * FD_ISSET is meaningless on these sockets
    591                          * (and they can crash the program)
    592                          */
    593                         if (so->so_state & SS_NOFDREF || so->s == -1)
    594                            continue;
    595596
    596597                        /*
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r14028 r14085  
    6161    so->s = -1;
    6262#if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    63     WSACreateEvent(so->hNetworkEvent); /*XXX: NOT correct place*/
     63    so->hNetworkEvent = WSACreateEvent(); /*XXX: NOT correct place*/
     64    AssertRelease(so->hNetworkEvent != WSA_INVALID_EVENT);
    6465#endif
    6566  }
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