-
- Downloads
upnp: refactor to improve handling of port mappings renewal
The two main changes are: 1) Renewal requests are now sent for both UPnP and NAT-PMP mappings, not just NAT-PMP. The old code asked for an infinite lifetime when creating UPnP mappings and assumed that it got it, but this is not a safe assumption. (See GitLab issue below for more information.) 2) The updateMappingList function was removed. This function used to be called every 30 seconds to handle a bunch of unrelated tasks (one of which was renewing port mappings) and generated mostly unnecessary network traffic every time when using UPnP (because of the call to pruneMappingList). These tasks are now performed separately instead of being bundled together, and only when needed (either based on a timer or on certain events occuring, depending on the task). GitLab: #31 Change-Id: Id0f60ddb76fb8eb4517eadbb971892d125cebfc7
Showing
- include/upnp/mapping.h 4 additions, 8 deletionsinclude/upnp/mapping.h
- include/upnp/upnp_context.h 76 additions, 104 deletionsinclude/upnp/upnp_context.h
- src/upnp/protocol/mapping.cpp 16 additions, 7 deletionssrc/upnp/protocol/mapping.cpp
- src/upnp/protocol/natpmp/nat_pmp.cpp 24 additions, 35 deletionssrc/upnp/protocol/natpmp/nat_pmp.cpp
- src/upnp/protocol/natpmp/nat_pmp.h 2 additions, 2 deletionssrc/upnp/protocol/natpmp/nat_pmp.h
- src/upnp/protocol/pupnp/pupnp.cpp 59 additions, 6 deletionssrc/upnp/protocol/pupnp/pupnp.cpp
- src/upnp/protocol/pupnp/pupnp.h 6 additions, 2 deletionssrc/upnp/protocol/pupnp/pupnp.h
- src/upnp/upnp_context.cpp 352 additions, 445 deletionssrc/upnp/upnp_context.cpp
- tools/upnp/upnpctrl.cpp 2 additions, 0 deletionstools/upnp/upnpctrl.cpp
Loading
Please register or sign in to comment