minissdpd: handle ssdp:update messages
This commit is contained in:
parent
3b71766493
commit
b405bdda2b
|
@ -1,5 +1,9 @@
|
|||
$Id: Changelog.txt,v 1.37 2014/11/28 16:20:57 nanard Exp $
|
||||
|
||||
2014/12/04:
|
||||
Fixes removing of devices on ssdp:byebye
|
||||
handle ssdp:update messages
|
||||
|
||||
2014/11/28:
|
||||
revert "listen on only 1 IPv4 if only 1 interface is specified"
|
||||
because it prevents broadcast messages to be received
|
||||
|
|
|
@ -572,12 +572,20 @@ ParseSSDPPacket(int s, const char * p, ssize_t n,
|
|||
(method==METHOD_NOTIFY)?headers[HEADER_NT].p:st);
|
||||
switch(method) {
|
||||
case METHOD_NOTIFY:
|
||||
if(nts==NTS_SSDP_ALIVE || nts==NTS_SSDP_UPDATE) {
|
||||
if(headers[HEADER_NT].p && headers[HEADER_USN].p && headers[HEADER_LOCATION].p) {
|
||||
if(nts==NTS_SSDP_ALIVE) {
|
||||
r = updateDevice(headers, time(NULL) + lifetime);
|
||||
} else {
|
||||
syslog(LOG_WARNING, "missing header nt=%p usn=%p location=%p",
|
||||
headers[HEADER_NT].p, headers[HEADER_USN].p,
|
||||
headers[HEADER_LOCATION].p);
|
||||
}
|
||||
else if(nts==NTS_SSDP_BYEBYE) {
|
||||
} else if(nts==NTS_SSDP_BYEBYE) {
|
||||
if(headers[HEADER_NT].p && headers[HEADER_USN].p) {
|
||||
r = removeDevice(headers);
|
||||
} else {
|
||||
syslog(LOG_WARNING, "missing header nt=%p usn=%p",
|
||||
headers[HEADER_NT].p, headers[HEADER_USN].p);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue