upnphttp.c: fix when compiling with UPNP_STRICT

This commit is contained in:
Thomas Bernard 2016-02-09 10:17:58 +01:00
parent d23bb8d670
commit 81e0ca10df
1 changed files with 12 additions and 9 deletions

View File

@ -664,8 +664,8 @@ with HTTP error 412 Precondition Failed. */
if(h->req_NTOff > 0) { if(h->req_NTOff > 0) {
syslog(LOG_WARNING, "Both NT: and SID: in SUBSCRIBE"); syslog(LOG_WARNING, "Both NT: and SID: in SUBSCRIBE");
BuildResp2_upnphttp(h, 400, "Incompatible header fields", 0, 0); BuildResp2_upnphttp(h, 400, "Incompatible header fields", 0, 0);
} else } else {
#endif #endif /* UPNP_STRICT */
sid = upnpevents_renewSubscription(h->req_buf + h->req_SIDOff, sid = upnpevents_renewSubscription(h->req_buf + h->req_SIDOff,
h->req_SIDLen, h->req_Timeout); h->req_SIDLen, h->req_Timeout);
if(!sid) { if(!sid) {
@ -675,6 +675,9 @@ with HTTP error 412 Precondition Failed. */
h->res_SID = sid; h->res_SID = sid;
BuildResp_upnphttp(h, 0, 0); BuildResp_upnphttp(h, 0, 0);
} }
#ifdef UPNP_STRICT
}
#endif /* UPNP_STRICT */
} }
SendRespAndClose_upnphttp(h); SendRespAndClose_upnphttp(h);
} }