|
a/libupnpp/upnpplib.cxx |
|
b/libupnpp/upnpplib.cxx |
|
... |
|
... |
59 |
|
59 |
|
60 |
LibUPnP::LibUPnP(bool serveronly, string* hwaddr,
|
60 |
LibUPnP::LibUPnP(bool serveronly, string* hwaddr,
|
61 |
const string ifname, const string inip, unsigned short port)
|
61 |
const string ifname, const string inip, unsigned short port)
|
62 |
: m_ok(false)
|
62 |
: m_ok(false)
|
63 |
{
|
63 |
{
|
64 |
LOGDEB("LibUPnP: serveronly " << serveronly << " &hwaddr " << hwaddr <<
|
64 |
LOGDEB1("LibUPnP: serveronly " << serveronly << " &hwaddr " << hwaddr <<
|
65 |
" ifname [" << ifname << "] inip [" << inip << "] port " << port
|
65 |
" ifname [" << ifname << "] inip [" << inip << "] port " << port
|
66 |
<< endl);
|
66 |
<< endl);
|
67 |
|
67 |
|
68 |
// If our caller wants to retrieve an ethernet address (typically
|
68 |
// If our caller wants to retrieve an ethernet address (typically
|
69 |
// for uuid purposes), or has specified an interface we have to
|
69 |
// for uuid purposes), or has specified an interface we have to
|
|
... |
|
... |
92 |
LOGERR(errAsString("UpnpInit", m_init_error) << endl);
|
92 |
LOGERR(errAsString("UpnpInit", m_init_error) << endl);
|
93 |
return;
|
93 |
return;
|
94 |
}
|
94 |
}
|
95 |
setMaxContentLength(2000*1024);
|
95 |
setMaxContentLength(2000*1024);
|
96 |
|
96 |
|
97 |
LOGDEB("Using IP " << UpnpGetServerIpAddress() << " port " <<
|
97 |
LOGDEB("LibUPnP: Using IP " << UpnpGetServerIpAddress() << " port " <<
|
98 |
UpnpGetServerPort() << endl);
|
98 |
UpnpGetServerPort() << endl);
|
99 |
|
99 |
|
100 |
#if defined(HAVE_UPNPSETLOGLEVEL)
|
100 |
#if defined(HAVE_UPNPSETLOGLEVEL)
|
101 |
UpnpCloseLog();
|
101 |
UpnpCloseLog();
|
102 |
#endif
|
102 |
#endif
|
|
... |
|
... |
203 |
if (ulib == 0) {
|
203 |
if (ulib == 0) {
|
204 |
// Because the asyncsearch calls uses a null cookie.
|
204 |
// Because the asyncsearch calls uses a null cookie.
|
205 |
//cerr << "o_callback: NULL ulib!" << endl;
|
205 |
//cerr << "o_callback: NULL ulib!" << endl;
|
206 |
ulib = theLib;
|
206 |
ulib = theLib;
|
207 |
}
|
207 |
}
|
208 |
LOGDEB("LibUPnP::o_callback: event type: " << evTypeAsString(et) << endl);
|
208 |
LOGDEB1("LibUPnP::o_callback: event type: " << evTypeAsString(et) << endl);
|
209 |
|
209 |
|
210 |
map<Upnp_EventType, Handler>::iterator it = ulib->m_handlers.find(et);
|
210 |
map<Upnp_EventType, Handler>::iterator it = ulib->m_handlers.find(et);
|
211 |
if (it != ulib->m_handlers.end()) {
|
211 |
if (it != ulib->m_handlers.end()) {
|
212 |
(it->second.handler)(et, evp, it->second.cookie);
|
212 |
(it->second.handler)(et, evp, it->second.cookie);
|
213 |
}
|
213 |
}
|