VirtualBox

Changeset 48875 in vbox


Ignore:
Timestamp:
Oct 4, 2013 6:10:20 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89546
Message:

VBoxNetLwipNAT: PortForwardListener uses default (de)constructor,

init's n_pNAT with init(...) functions,
PortForwardListener::HandleEvent checks m_pNAT before proxying event.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r48873 r48875  
    178178{
    179179public:
    180     PortForwardListener(){}
    181     virtual ~PortForwardListener(){}
    182     HRESULT init(VBoxNetLwipNAT *pNAT) { m_pNAT = pNAT; return S_OK; }
    183     HRESULT init() { return S_OK; }
    184     void uninit(){}
     180    HRESULT init(VBoxNetLwipNAT *pNAT)
     181    {
     182        m_pNAT = pNAT;
     183        return S_OK;
     184    }
     185    HRESULT init() { return init(NULL); }
     186    void uninit() { init(NULL); }
    185187    STDMETHOD(HandleEvent)(VBoxEventType_T aEventType, IEvent *pEvent)
    186     {return m_pNAT->HandleEvent(aEventType, pEvent);};
     188    {
     189        if (m_pNAT)
     190            return m_pNAT->HandleEvent(aEventType, pEvent);
     191        else
     192            return E_FAIL;
     193    }
    187194private:
    188195    VBoxNetLwipNAT *m_pNAT;
Note: See TracChangeset for help on using the changeset viewer.

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