send ssdp:all requests to MiniSSDPD correctly

This commit is contained in:
Thomas Bernard 2014-02-03 16:40:42 +01:00
parent bf3a91ba83
commit 4d62c19c29
1 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,7 @@
/* Project : miniupnp
* Web : http://miniupnp.free.fr/
* Author : Thomas BERNARD
* copyright (c) 2005-2012 Thomas Bernard
* copyright (c) 2005-2014 Thomas Bernard
* This software is subjet to the conditions detailed in the
* provided LICENCE file. */
/*#include <syslog.h>*/
@ -72,7 +72,14 @@ getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
return NULL;
}
stsize = strlen(devtype);
if(stsize == 8 && 0 == memcmp(devtype, "ssdp:all", 8))
{
buffer[0] = 3; /* request type 3 : everything */
}
else
{
buffer[0] = 1; /* request type 1 : request devices/services by type */
}
p = buffer + 1;
l = stsize; CODELENGTH(l, p);
if(p + stsize > buffer + sizeof(buffer))