Add UPnP detection results to the Crash dump.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8557 4a71c877-e1ca-e34f-864e-861f7616d084
master
Buginator 2009-11-28 21:18:34 +00:00 committed by Git SVN Gateway
parent 25b9dc9ba6
commit e8d4d378a8
1 changed files with 9 additions and 1 deletions

View File

@ -26,7 +26,7 @@
#include "lib/framework/frame.h"
#include "lib/framework/string_ext.h"
#include "lib/gamelib/gtime.h"
#include "src/component.h"
#include "src/component.h" // FIXME: we need to handle this better
#include <time.h> // for stats
#include <SDL_timer.h>
#include <physfs.h>
@ -38,6 +38,7 @@
#include "miniupnpc/miniwget.h"
#include "miniupnpc/miniupnpc.h"
#include "miniupnpc/upnpcommands.h"
#include "lib/exceptionhandler/dumpinfo.h"
#if defined(WZ_OS_UNIX)
# include <arpa/inet.h>
@ -1820,6 +1821,7 @@ static int upnp_init(void *asdf)
struct UPNPDev *dev;
char *descXML;
int descXMLsize = 0;
char buf[255];
memset(&urls, 0, sizeof(struct UPNPUrls));
memset(&data, 0, sizeof(struct IGDdatas));
@ -1855,10 +1857,16 @@ static int upnp_init(void *asdf)
if (!urls.controlURL || urls.controlURL[0] == '\0')
{
ssprintf(buf, "UPnP device found: %s %s LAN address %s, but failed controlURL", dev->descURL, dev->st, lanaddr);
addDumpInfo(buf);
return false;
}
ssprintf(buf, "UPnP device found: %s %s LAN address %s", dev->descURL, dev->st, lanaddr);
addDumpInfo(buf);
return true;
}
ssprintf(buf, "UPnP device not found.");
addDumpInfo(buf);
debug(LOG_NET, "No UPnP devices found.");
return false;
}