Add --disable-optssdp option
Modify configure.ac to add --disable-optssdp option. This option will
remove OPT, 01-NLS and X_USER_AGENT headers from SSDP messages as those
headers are optional. If --disable-gena and disable-optssdp are both
used, uuid part will not be compiled anymore.
(cherry picked from commit 731512b0e5
)
This commit is contained in:
parent
fec6069a21
commit
b53d552d3f
@ -318,6 +318,15 @@ Version 1.8.0
|
|||||||
Version 1.6.16
|
Version 1.6.16
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
|
2012-03-15 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
|
||||||
|
|
||||||
|
Add --disable-optssdp option
|
||||||
|
|
||||||
|
Modify configure.ac to add --disable-optssdp option. This option will
|
||||||
|
remove OPT, 01-NLS and X_USER_AGENT headers from SSDP messages as those
|
||||||
|
headers are optional. If --disable-gena and disable-optssdp are both
|
||||||
|
used, uuid part will not be compiled anymore.
|
||||||
|
|
||||||
2012-03-15 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
|
2012-03-15 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
|
||||||
|
|
||||||
Bug fix in ixmlNode_allowChildren
|
Bug fix in ixmlNode_allowChildren
|
||||||
|
@ -153,6 +153,9 @@
|
|||||||
/* see upnpconfig.h */
|
/* see upnpconfig.h */
|
||||||
#define UPNP_HAVE_SSDP 1
|
#define UPNP_HAVE_SSDP 1
|
||||||
|
|
||||||
|
/* see upnpconfig.h */
|
||||||
|
#define UPNP_HAVE_OPTSSDP 1
|
||||||
|
|
||||||
/* see upnpconfig.h */
|
/* see upnpconfig.h */
|
||||||
#define UPNP_HAVE_TOOLS 1
|
#define UPNP_HAVE_TOOLS 1
|
||||||
|
|
||||||
|
@ -105,6 +105,11 @@
|
|||||||
#define UPNP_HAVE_SSDP 1
|
#define UPNP_HAVE_SSDP 1
|
||||||
|
|
||||||
|
|
||||||
|
/** Defined to 1 if the library has been compiled with optional SSDP headers
|
||||||
|
* support (i.e. configure --enable-optssdp) */
|
||||||
|
#define UPNP_HAVE_OPTSSDP 1
|
||||||
|
|
||||||
|
|
||||||
/** Defined to 1 if the library has been compiled with the SOAP part enabled
|
/** Defined to 1 if the library has been compiled with the SOAP part enabled
|
||||||
* (i.e. configure --enable-soap) */
|
* (i.e. configure --enable-soap) */
|
||||||
#define UPNP_HAVE_SOAP 1
|
#define UPNP_HAVE_SOAP 1
|
||||||
|
@ -403,6 +403,12 @@ if test "x$enable_ssdp" = xyes ; then
|
|||||||
AC_DEFINE(UPNP_HAVE_SSDP, 1, [see upnpconfig.h])
|
AC_DEFINE(UPNP_HAVE_SSDP, 1, [see upnpconfig.h])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
RT_BOOL_ARG_ENABLE([optssdp], [yes], [optionnal SSDP headers support)])
|
||||||
|
if test "x$enable_optssdp" = xyes ; then
|
||||||
|
AC_DEFINE(UPNP_HAVE_OPTSSDP, 1, [see upnpconfig.h])
|
||||||
|
enable_uuid=yes
|
||||||
|
fi
|
||||||
|
|
||||||
RT_BOOL_ARG_ENABLE([soap], [yes], [SOAP part])
|
RT_BOOL_ARG_ENABLE([soap], [yes], [SOAP part])
|
||||||
if test "x$enable_soap" = xyes ; then
|
if test "x$enable_soap" = xyes ; then
|
||||||
AC_DEFINE(UPNP_HAVE_SOAP, 1, [see upnpconfig.h])
|
AC_DEFINE(UPNP_HAVE_SOAP, 1, [see upnpconfig.h])
|
||||||
@ -411,8 +417,11 @@ fi
|
|||||||
RT_BOOL_ARG_ENABLE([gena], [yes], [GENA part])
|
RT_BOOL_ARG_ENABLE([gena], [yes], [GENA part])
|
||||||
if test "x$enable_gena" = xyes ; then
|
if test "x$enable_gena" = xyes ; then
|
||||||
AC_DEFINE(UPNP_HAVE_GENA, 1, [see upnpconfig.h])
|
AC_DEFINE(UPNP_HAVE_GENA, 1, [see upnpconfig.h])
|
||||||
|
enable_uuid=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL(ENABLE_UUID, test x"$enable_uuid" = xyes)
|
||||||
|
|
||||||
RT_BOOL_ARG_ENABLE([tools], [yes], [helper APIs in upnptools.h])
|
RT_BOOL_ARG_ENABLE([tools], [yes], [helper APIs in upnptools.h])
|
||||||
if test "x$enable_tools" = xyes ; then
|
if test "x$enable_tools" = xyes ; then
|
||||||
AC_DEFINE(UPNP_HAVE_TOOLS, 1, [see upnpconfig.h])
|
AC_DEFINE(UPNP_HAVE_TOOLS, 1, [see upnpconfig.h])
|
||||||
|
@ -162,10 +162,12 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# uuid
|
# uuid
|
||||||
|
if ENABLE_UUID
|
||||||
libupnp_la_SOURCES += \
|
libupnp_la_SOURCES += \
|
||||||
src/uuid/md5.c \
|
src/uuid/md5.c \
|
||||||
src/uuid/sysdep.c \
|
src/uuid/sysdep.c \
|
||||||
src/uuid/uuid.c
|
src/uuid/uuid.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# urlconfig
|
# urlconfig
|
||||||
|
@ -104,6 +104,11 @@
|
|||||||
#undef UPNP_HAVE_SSDP
|
#undef UPNP_HAVE_SSDP
|
||||||
|
|
||||||
|
|
||||||
|
/** Defined to 1 if the library has been compiled with optional SSDP headers
|
||||||
|
* support (i.e. configure --enable-optssdp) */
|
||||||
|
#undef UPNP_HAVE_OPTSSDP
|
||||||
|
|
||||||
|
|
||||||
/** Defined to 1 if the library has been compiled with the SOAP part enabled
|
/** Defined to 1 if the library has been compiled with the SOAP part enabled
|
||||||
* (i.e. configure --enable-soap) */
|
* (i.e. configure --enable-soap) */
|
||||||
#undef UPNP_HAVE_SOAP
|
#undef UPNP_HAVE_SOAP
|
||||||
|
@ -179,8 +179,10 @@ int UpnpSdkDeviceRegisteredV4 = 0;
|
|||||||
* == 0 if unregistered, == 1 if registered. */
|
* == 0 if unregistered, == 1 if registered. */
|
||||||
int UpnpSdkDeviceregisteredV6 = 0;
|
int UpnpSdkDeviceregisteredV6 = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_UPNP_OPTSSDP
|
||||||
/*! Global variable used in discovery notifications. */
|
/*! Global variable used in discovery notifications. */
|
||||||
Upnp_SID gUpnpSdkNLSuuid;
|
Upnp_SID gUpnpSdkNLSuuid;
|
||||||
|
#endif /* HAVE_UPNP_OPTSSDP */
|
||||||
|
|
||||||
/*! Global variable used as to store the OpenSSL context object
|
/*! Global variable used as to store the OpenSSL context object
|
||||||
* to be used for all SSL/TLS connections
|
* to be used for all SSL/TLS connections
|
||||||
@ -320,7 +322,9 @@ static int UpnpInitPreamble(void)
|
|||||||
{
|
{
|
||||||
int retVal = UPNP_E_SUCCESS;
|
int retVal = UPNP_E_SUCCESS;
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
uuid_upnp nls_uuid;
|
uuid_upnp nls_uuid;
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
|
|
||||||
retVal = WinsockInit();
|
retVal = WinsockInit();
|
||||||
if (retVal != UPNP_E_SUCCESS) {
|
if (retVal != UPNP_E_SUCCESS) {
|
||||||
@ -345,9 +349,11 @@ static int UpnpInitPreamble(void)
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
/* Create the NLS uuid. */
|
/* Create the NLS uuid. */
|
||||||
uuid_create(&nls_uuid);
|
uuid_create(&nls_uuid);
|
||||||
uuid_unpack(&nls_uuid, gUpnpSdkNLSuuid);
|
uuid_unpack(&nls_uuid, gUpnpSdkNLSuuid);
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
|
|
||||||
/* Initializes the handle list. */
|
/* Initializes the handle list. */
|
||||||
HandleLock();
|
HandleLock();
|
||||||
|
@ -343,6 +343,7 @@ static void CreateServicePacket(
|
|||||||
*packet = NULL;
|
*packet = NULL;
|
||||||
if (msg_type == MSGTYPE_REPLY) {
|
if (msg_type == MSGTYPE_REPLY) {
|
||||||
if (PowerState > 0) {
|
if (PowerState > 0) {
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
ret_code = http_MakeMessage(&buf, 1, 1,
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
"R" "sdc" "D" "sc" "ssc" "ssc" "ssc"
|
"R" "sdc" "D" "sc" "ssc" "ssc" "ssc"
|
||||||
"S" "Xc" "ssc" "ssc"
|
"S" "Xc" "ssc" "ssc"
|
||||||
@ -357,7 +358,21 @@ static void CreateServicePacket(
|
|||||||
"SleepPeriod: ", SleepPeriod,
|
"SleepPeriod: ", SleepPeriod,
|
||||||
"RegistrationState: ",
|
"RegistrationState: ",
|
||||||
RegistrationState);
|
RegistrationState);
|
||||||
|
#else
|
||||||
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
|
"R" "sdc" "D" "sc" "ssc"
|
||||||
|
"S" "ssc" "ssc"
|
||||||
|
"sdc" "sdc" "sdcc", HTTP_OK,
|
||||||
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
|
"EXT:", "LOCATION: ", location,
|
||||||
|
"ST: ", nt, "USN: ",
|
||||||
|
usn, "Powerstate: ", PowerState,
|
||||||
|
"SleepPeriod: ", SleepPeriod,
|
||||||
|
"RegistrationState: ",
|
||||||
|
RegistrationState);
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
ret_code = http_MakeMessage(&buf, 1, 1,
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
"R" "sdc" "D" "sc" "ssc" "ssc" "ssc"
|
"R" "sdc" "D" "sc" "ssc" "ssc" "ssc"
|
||||||
"S" "Xc" "ssc" "sscc", HTTP_OK,
|
"S" "Xc" "ssc" "sscc", HTTP_OK,
|
||||||
@ -368,6 +383,14 @@ static void CreateServicePacket(
|
|||||||
"01-NLS: ", gUpnpSdkNLSuuid,
|
"01-NLS: ", gUpnpSdkNLSuuid,
|
||||||
X_USER_AGENT, "ST: ", nt, "USN: ",
|
X_USER_AGENT, "ST: ", nt, "USN: ",
|
||||||
usn);
|
usn);
|
||||||
|
#else
|
||||||
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
|
"R" "sdc" "D" "sc" "ssc"
|
||||||
|
"S" "ssc" "sscc", HTTP_OK,
|
||||||
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
|
"EXT:", "LOCATION: ", location,
|
||||||
|
"ST: ", nt, "USN: ", usn);
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
}
|
}
|
||||||
if (ret_code != 0) {
|
if (ret_code != 0) {
|
||||||
return;
|
return;
|
||||||
@ -394,6 +417,7 @@ static void CreateServicePacket(
|
|||||||
host = "[" SSDP_IPV6_LINKLOCAL "]";
|
host = "[" SSDP_IPV6_LINKLOCAL "]";
|
||||||
}
|
}
|
||||||
if (PowerState > 0) {
|
if (PowerState > 0) {
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
ret_code = http_MakeMessage(&buf, 1, 1,
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc"
|
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc"
|
||||||
"ssc" "ssc" "S" "Xc" "ssc"
|
"ssc" "ssc" "S" "Xc" "ssc"
|
||||||
@ -409,7 +433,23 @@ static void CreateServicePacket(
|
|||||||
PowerState, "SleepPeriod: ",
|
PowerState, "SleepPeriod: ",
|
||||||
SleepPeriod, "RegistrationState: ",
|
SleepPeriod, "RegistrationState: ",
|
||||||
RegistrationState);
|
RegistrationState);
|
||||||
|
#else
|
||||||
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
|
"Q" "sssdc" "sdc" "ssc"
|
||||||
|
"ssc" "ssc" "S" "ssc"
|
||||||
|
"sdc" "sdc" "sdcc",
|
||||||
|
HTTPMETHOD_NOTIFY, "*", (size_t) 1,
|
||||||
|
"HOST: ", host, ":", SSDP_PORT,
|
||||||
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
|
"LOCATION: ", location, "NT: ", nt,
|
||||||
|
"NTS: ", nts,
|
||||||
|
"USN: ", usn, "Powerstate: ",
|
||||||
|
PowerState, "SleepPeriod: ",
|
||||||
|
SleepPeriod, "RegistrationState: ",
|
||||||
|
RegistrationState);
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef UPNP_HAVE_OPTSSDP
|
||||||
ret_code = http_MakeMessage(&buf, 1, 1,
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc"
|
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc"
|
||||||
"ssc" "ssc" "S" "Xc" "sscc",
|
"ssc" "ssc" "S" "Xc" "sscc",
|
||||||
@ -421,6 +461,16 @@ static void CreateServicePacket(
|
|||||||
"01-NLS: ", gUpnpSdkNLSuuid, "NT: ",
|
"01-NLS: ", gUpnpSdkNLSuuid, "NT: ",
|
||||||
nt, "NTS: ", nts, X_USER_AGENT,
|
nt, "NTS: ", nts, X_USER_AGENT,
|
||||||
"USN: ", usn);
|
"USN: ", usn);
|
||||||
|
#else
|
||||||
|
ret_code = http_MakeMessage(&buf, 1, 1,
|
||||||
|
"Q" "sssdc" "sdc" "ssc"
|
||||||
|
"ssc" "ssc" "S" "sscc",
|
||||||
|
HTTPMETHOD_NOTIFY, "*", (size_t) 1,
|
||||||
|
"HOST: ", host, ":", SSDP_PORT,
|
||||||
|
"CACHE-CONTROL: max-age=", duration,
|
||||||
|
"LOCATION: ", location, "NT: ", nt,
|
||||||
|
"NTS: ", nts, "USN: ", usn);
|
||||||
|
#endif /* UPNP_HAVE_OPTSSDP */
|
||||||
}
|
}
|
||||||
if (ret_code)
|
if (ret_code)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user