HomeWildfire Games

Cache UPnP root URL to try to avoid searching each time. Also make searching…

Description

Cache UPnP root URL to try to avoid searching each time. Also make searching asyncronous with the GUI to avoid hanging.

Details

Committed
JoshuaJBDec 17 2013, 3:21 PM
Parents
rP14369: Ptolemaic dock draft commit
Branches
Unknown
Tags
Unknown

Event Timeline

elexis raised a concern with this commit.EditedAug 16 2019, 2:52 PM
elexis added a subscriber: elexis.

Please correct me if I'm wrong, but if I'm not mistaken the early returns invalidate the // Make sure everything is properly freed. part from rP14348.

http://irclogs.wildfiregames.com/2013-12/2013-12-13-QuakeNet-%230ad-dev.log

23:41 <@historicbruno> will also have to fix the OS X build
23:41 < Josh> I think I messed up the build I did
23:42 < Josh> historicbruno: Thanks for sorting that out BTW
23:42 <@historicbruno> we don't call freeUPNPDevlist
23:44 < Josh> historicbruno: Are you fixing that already?
23:44 < Josh> Or should I commit a fix?
23:44 <@historicbruno> nope, just noticing it while reading the comments :)
23:44 <@historicbruno> also FreeUPNPUrls, and there may be more
23:46 < Josh> historicbruno: Alright. Our implementation is really just a modified version of bits and pieces of the demo/diagnostic in upnpc.c.
This commit now has outstanding concerns.Aug 16 2019, 2:52 PM
elexis removed an auditor: elexis.Aug 16 2019, 8:11 PM

For real:

==15080== 148 bytes in 1 blocks are definitely lost in loss record 2,224 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x630E7E5: ssdpDiscoverDevices (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x630973A: upnpDiscover (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191253: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:252)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)


==15080== 36 bytes in 1 blocks are definitely lost in loss record 788 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x671A36E: strdup (in /usr/lib/libc-2.29.so)
==15080==    by 0x63097EC: GetUPNPUrls (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309BE4: UPNP_GetValidIGD (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191282: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:257)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)

=15080== 26 bytes in 1 blocks are definitely lost in loss record 243 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x6308D5E: ??? (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x630980C: GetUPNPUrls (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309BE4: UPNP_GetValidIGD (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191282: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:257)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)
==15080== 
==15080== 26 bytes in 1 blocks are definitely lost in loss record 244 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x6308D5E: ??? (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309825: GetUPNPUrls (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309BE4: UPNP_GetValidIGD (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191282: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:257)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)
==15080== 
==15080== 26 bytes in 1 blocks are definitely lost in loss record 245 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x6308D5E: ??? (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x630983E: GetUPNPUrls (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309BE4: UPNP_GetValidIGD (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191282: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:257)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)
==15080== 
==15080== 26 bytes in 1 blocks are definitely lost in loss record 246 of 3,227
==15080==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==15080==    by 0x6308D5E: ??? (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309857: GetUPNPUrls (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x6309BE4: UPNP_GetValidIGD (in /usr/lib/libminiupnpc.so.17)
==15080==    by 0x191282: CNetServerWorker::SetupUPnP(void*) (NetServer.cpp:257)
==15080==    by 0x667757E: start_thread (in /usr/lib/libpthread-2.29.so)
==15080==    by 0x678B0E2: clone (in /usr/lib/libc-2.29.so)
==15080==

fixed in rP22675.

This commit no longer requires audit.Aug 16 2019, 8:11 PM