VirtualBox

Changeset 87923 in vbox


Ignore:
Timestamp:
Mar 2, 2021 7:58:53 PM (4 years ago)
Author:
vboxsync
Message:

VBoxIntnetPcap: Add -U/--packet-buffered option. bugref:9959.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxIntnetPcap/VBoxIntnetPcap.cpp

    r87910 r87923  
    3636IntNetIf g_net;
    3737PRTSTREAM g_pStrmOut;
     38bool g_fPacketBuffered;
    3839uint64_t g_u64Count;
    3940size_t g_cbSnapLen;
     
    4546    { "--network",              'n',   RTGETOPT_REQ_STRING },
    4647    { "--snaplen",              's',   RTGETOPT_REQ_UINT32 },
     48    { "--packet-buffered",      'U',   RTGETOPT_REQ_NOTHING },
    4749    { "--write",                'w',   RTGETOPT_REQ_STRING },
    4850};
     
    100102                                          "--snaplen must be greater than zero");
    101103                g_cbSnapLen = Val.u32;
     104                break;
     105
     106            case 'U':           /* --packet-buffered */
     107                g_fPacketBuffered = true;
    102108                break;
    103109
     
    191197        return RTMsgErrorExit(RTEXITCODE_FAILURE,
    192198                              "write: %Rrf", rc);
     199    if (g_fPacketBuffered)
     200        RTStrmFlush(g_pStrmOut);
    193201
    194202    g_net.ifPump();
     
    224232    }
    225233
     234    if (g_fPacketBuffered)
     235        RTStrmFlush(g_pStrmOut);
     236
    226237    checkCaptureLimit();
    227238}
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