miniupnpd: Fix UPnP UDA 1.1 subscribe timeout compliance

SHOULD be greater than or equal to 1800 seconds (30 minutes).
http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
4.1.2 p91.

see https://github.com/miniupnp/miniupnp/pull/686
This commit is contained in:
Self-Hosting-Group 2024-01-08 20:32:48 +01:00 committed by Thomas Bernard
parent e98515ac5e
commit 30baf316b4
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 8 additions and 3 deletions

View File

@ -643,8 +643,7 @@ ProcessHTTPSubscribe_upnphttp(struct upnphttp * h, const char * path)
h->req_Timeout);
syslog(LOG_DEBUG, "SID '%.*s'", h->req_SIDLen, h->req_buf + h->req_SIDOff);
#if defined(UPNP_STRICT) && (UPNP_VERSION_MAJOR > 1) || (UPNP_VERSION_MINOR > 0)
/*if(h->req_Timeout < 1800) {*/
if(h->req_Timeout == 0) {
if(h->req_Timeout < 1800) {
/* Second-infinite is forbidden with UDA v1.1 and later :
* (UDA 1.1 : 4.1.1 Subscription)
* UPnP 1.1 control points MUST NOT subscribe using keyword infinite,
@ -653,7 +652,13 @@ ProcessHTTPSubscribe_upnphttp(struct upnphttp * h, const char * path)
* ignored by a UPnP 1.1 device (the presence of infinite is handled
* by the device as if the TIMEOUT header field in a request was not
* present) . The keyword infinite MUST NOT be returned by a UPnP 1.1
* device. */
* device.
* Also the device must return a value of minimum 1800 seconds in the
* response, according to UDA 1.1 (4.1.2 SUBSCRIBE with NT and CALLBACK):
* TIMEOUT
* REQUIRED. Field value contains actual duration until subscription
* expires. Keyword "Second-" followed by an integer (no space).
* SHOULD be greater than or equal to 1800 seconds (30 minutes).*/
h->req_Timeout = 1800; /* default to 30 minutes */
}
#endif /* UPNP_STRICT */