VirtualBox

Ignore:
Timestamp:
Feb 4, 2009 10:14:33 AM (16 years ago)
Author:
vboxsync
Message:

NAT: soread aware of reading from closing socket

File:
1 edited

Legend:

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

    r16498 r16501  
    100100#ifdef VBOX_WITH_SLIRP_MT
    101101void
    102 soread_queue(PNATState pData, struct socket *so, int fCloseIfNothingRead, int *ret)
    103 {
    104     *ret = soread(pData, so, fCloseIfNothingRead);
     102soread_queue(PNATState pData, struct socket *so, int *ret)
     103{
     104    *ret = soread(pData, so);
    105105}
    106106#endif
     
    112112 */
    113113int
    114 soread(PNATState pData, struct socket *so, int fCloseIfNothingRead)
     114soread(PNATState pData, struct socket *so)
    115115{
    116116    int n, nn, lss, total;
     
    202202         * would be dangerous.
    203203         */
    204         if (nn == 0 && !fCloseIfNothingRead)
     204        int status = 0;
     205        unsigned long pended = 0;
     206        int ignored;
     207        status = WSAIoctl(so->s, FIONREAD, NULL, 0, &pended, sizeof(unsigned long), &ignored, NULL, NULL);
     208        if(status < 0)
     209        {
     210            Log2(("error in WSAIoctl: %d\n", WSAGetLastError()));
     211        }
     212        if (nn == 0 && (pended != 0))
    205213        {
    206214            SOCKET_UNLOCK(so);
     
    278286     * urgent data.
    279287     */
    280     soread(pData, so, /*fCloseIfNothingRead=*/false);
     288    soread(pData, so);
    281289    tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
    282290    tp->t_force = 1;
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