several memory leaks and potential reasons for a crash removed (thanks to loigu)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@13 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
142929623d
commit
a22ba2f159
@ -4213,33 +4213,6 @@ UpnpSetContentLength( IN UpnpClient_Handle Hnd,
|
||||
IN int contentLength
|
||||
/** Permissible content length */
|
||||
)
|
||||
{
|
||||
return UpnpSetMaxContentLength (contentLength);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Function: UpnpSetMaxContentLength
|
||||
*
|
||||
* Parameters:
|
||||
* IN int contentLength: The maximum size to be set
|
||||
*
|
||||
* Description:
|
||||
* Sets the maximum content-length that the SDK will process on an
|
||||
* incoming SOAP requests or responses. This API allows devices that have
|
||||
* memory constraints to exhibit consistent behaviour if the size of the
|
||||
* incoming SOAP message exceeds the memory that device can allocate.
|
||||
* The default maximum content-length is {\tt DEFAULT_SOAP_CONTENT_LENGTH}
|
||||
* = 16K bytes.
|
||||
*
|
||||
* Return Values: int
|
||||
* UPNP_E_SUCCESS: The operation completed successfully.
|
||||
*
|
||||
***************************************************************************/
|
||||
int
|
||||
UpnpSetMaxContentLength (
|
||||
IN size_t contentLength
|
||||
/** Permissible content length, in bytes */
|
||||
)
|
||||
{
|
||||
int errCode = UPNP_E_SUCCESS;
|
||||
struct Handle_Info *HInfo = NULL;
|
||||
@ -4273,4 +4246,45 @@ UpnpSetMaxContentLength (
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Function: UpnpSetMaxContentLength
|
||||
*
|
||||
* Parameters:
|
||||
* IN int contentLength: The maximum size to be set
|
||||
*
|
||||
* Description:
|
||||
* Sets the maximum content-length that the SDK will process on an
|
||||
* incoming SOAP requests or responses. This API allows devices that have
|
||||
* memory constraints to exhibit consistent behaviour if the size of the
|
||||
* incoming SOAP message exceeds the memory that device can allocate.
|
||||
* The default maximum content-length is {\tt DEFAULT_SOAP_CONTENT_LENGTH}
|
||||
* = 16K bytes.
|
||||
*
|
||||
* Return Values: int
|
||||
* UPNP_E_SUCCESS: The operation completed successfully.
|
||||
*
|
||||
***************************************************************************/
|
||||
int
|
||||
UpnpSetMaxContentLength (
|
||||
IN size_t contentLength
|
||||
/** Permissible content length, in bytes */
|
||||
)
|
||||
{
|
||||
int errCode = UPNP_E_SUCCESS;
|
||||
|
||||
do {
|
||||
if( UpnpSdkInit != 1 ) {
|
||||
errCode = UPNP_E_FINISH;
|
||||
break;
|
||||
}
|
||||
|
||||
g_maxContentLength = contentLength;
|
||||
|
||||
} while( 0 );
|
||||
|
||||
return errCode;
|
||||
|
||||
}
|
||||
|
||||
/*********************** END OF FILE upnpapi.c :) ************************/
|
||||
|
@ -57,7 +57,7 @@
|
||||
#define DEFAULT_SOAP_CONTENT_LENGTH 16000
|
||||
#define MAX_SOAP_CONTENT_LENGTH 32000
|
||||
|
||||
extern int g_maxContentLength;
|
||||
extern size_t g_maxContentLength;
|
||||
|
||||
// 30-second timeout
|
||||
#define UPNP_TIMEOUT 30
|
||||
|
Loading…
x
Reference in New Issue
Block a user