minissdpd: handle ssdp:update messages

This commit is contained in:
Thomas Bernard 2014-12-04 11:41:19 +01:00
parent 3b71766493
commit b405bdda2b
2 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -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(headers[HEADER_NT].p && headers[HEADER_USN].p && headers[HEADER_LOCATION].p) {
if(nts==NTS_SSDP_ALIVE) {
if(nts==NTS_SSDP_ALIVE || nts==NTS_SSDP_UPDATE) {
if(headers[HEADER_NT].p && headers[HEADER_USN].p && headers[HEADER_LOCATION].p) {
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;