0ad/source/network
Dunedan 18d7746c84
Fix adding port forwardings using UPnP
The UPnP implementation included a combination of two subtle bugs, which
resulted in failure to create port forwardings every time after the
first one.

When using UPnP, the internet gateway to create the port forwardings at
needs to discovered. As that takes a while, the its root descriptor URL
was supposed to be cached after successful discovery in the user config
in "network.upnprootdescurl". However, instead of caching the root
descriptor URL, the control URL got cached. That caused following
requests to the root descriptor URL to fail, as they ended up at the
control URL instead. As such requests might also fail when the network
topology changed, the code was supposed to fall back to discovering the
internet gateway again when the cached one didn't work. However, due to
the inner workings of miniupnpc the request using the cached root
descriptor URL didn't result in an error, so the new discovery was never
triggered. As the wrong value was persisted in the user config there was
also no way to get out of this situation again.

This commit fixes both of these bugs.

As far as I can tell these bugs existed since the introduction of the
caching of the root descriptor URL in 0ba25e9968, which means creating
port forwardings using UPnP has been broken since Alpha 15.
2025-02-24 08:23:07 +01:00
..
scripting Fix /kick or /ban segfaulting in singleplayer 2025-02-09 18:50:15 +01:00
tests Always use STUN for hosting games using the lobby 2025-01-20 06:52:14 +01:00
FSM.h Make CFsm a template 2024-05-04 16:13:02 +00:00
NetClient.cpp Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetClient.h Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetClientTurnManager.cpp Replace usage of OSString().c_str() by OSString 2024-10-28 16:35:49 +01:00
NetClientTurnManager.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetEnet.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetEnet.h Use a lower default MTU for ENet hosts, and make it configurable. 2023-04-10 08:21:07 +00:00
NetFileTransfer.cpp Enable multiple RequestTypes 2024-12-19 21:36:51 +01:00
NetFileTransfer.h Enable multiple RequestTypes 2024-12-19 21:36:51 +01:00
NetHost.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetHost.h Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetMessage.cpp Multiplayer saved games 2024-12-19 21:36:51 +01:00
NetMessage.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetMessages.h Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetMessageSim.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetProtocol.cpp Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetProtocol.h Adding Engine Version and Mod name/version checks to multiplayer handshake. 2025-01-25 07:39:32 +01:00
NetServer.cpp Fix adding port forwardings using UPnP 2025-02-24 08:23:07 +01:00
NetServer.h Create port forwarding for correct port with UPnP 2025-02-22 20:26:30 +01:00
NetServerTurnManager.cpp Multicast chat messages 2024-12-27 19:32:03 +01:00
NetServerTurnManager.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetSession.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetSession.h Make CFsm a template 2024-05-04 16:13:02 +00:00
NetStats.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetStats.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NMTCreator.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
Serialization.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
StringConverters.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
StunClient.cpp Reduce time needed for STUN 2024-08-23 21:00:15 +02:00
StunClient.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00