提交 4f97df46 authored 作者: Michael Jerris's avatar Michael Jerris

printers do not route to the internet, in fact, all printers do is kill trees,…

printers do not route to the internet, in fact, all printers do is kill trees, killers are evil and as such should be ignored

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16601 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 df9632f2
......@@ -83,7 +83,8 @@ static switch_status_t get_upnp_pubaddr(char *pub_addr)
static int init_upnp(void)
{
struct UPNPDev *devlist;
struct UPNPDev *dev;
struct UPNPDev *dev = NULL;
struct UPNPDev *trydev = NULL;
char *descXML;
int descXMLsize = 0;
const char *multicastif = 0;
......@@ -99,13 +100,23 @@ static int init_upnp(void)
if (strstr(dev->st, "InternetGatewayDevice")) {
break;
}
if (!trydev && !switch_stristr("printer", dev->descURL)) {
trydev = dev;
}
dev = dev->pNext;
}
if (!dev) {
dev = devlist; /* defaulting to first device */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice, using first entry as default (%s).\n", dev->descURL);
}
}
if (!dev && trydev) {
dev = trydev; /* defaulting to first device */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice, using first entry as default (%s).\n", dev->descURL);
} else if (devlist && !dev && !trydev) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No InternetGatewayDevice found and I am NOT going to try your printer because printers should not route to the internet, that would be DAFT\n");
}
if (dev) {
descXML = miniwget(dev->descURL, &descXMLsize);
nat_globals.descURL = strdup(dev->descURL);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论