From 7f1e164a5a71515d4afddf70dd17d2e5c0e67ef8 Mon Sep 17 00:00:00 2001 From: Chandra Penke Date: Thu, 9 Sep 2010 18:22:36 -0700 Subject: [PATCH] SUMMARY: Minor change in comment for SetMaxContentLenght in upnp.h This is a follow up from issue 6 in tracker id 3056713: calling UpnpSetMaxContentLength() by passing '0' disables the content length checking. This is useful for developing some prototype applications that deal with a lot of XML/SOAP data, and for debugging. The corresponding c file change is already in the pupnp tree. Copy/pasting the relevant block of code here for clarity: In upnp/src/genlib/net/http/httpreadwrite.c: if (g_maxContentLength > 0 && parser->content_length > (unsigned int)g_maxContentLength) { *http_error_code = HTTP_REQ_ENTITY_TOO_LARGE; line = __LINE__; ret = UPNP_E_OUTOF_BOUNDS; goto ExitFunction; } This block of code checks only does the bounds check if g_maxContentLength > 0, and it's only place g_maxContentLength is checked. Attached is a patch against the latest sources. --- upnp/inc/upnp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upnp/inc/upnp.h b/upnp/inc/upnp.h index dcc37cd..aec2bdd 100644 --- a/upnp/inc/upnp.h +++ b/upnp/inc/upnp.h @@ -1125,6 +1125,8 @@ EXPORT_SPEC int UpnpSetContentLength( * behaviour if the size of the incoming SOAP message exceeds the memory that * device can allocate. * + * If set to 0 then checking will be disabled. + * * The default maximum content-length is \c DEFAULT_SOAP_CONTENT_LENGTH * = 16K bytes. *