SF Tracker [ 1628575 ] Linksys WRT54G patch

Submitted By: 
Fredrik Svensson - svefredrik



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@116 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2007-01-06 19:35:23 +00:00
parent c6d3d63223
commit 436bc8fc6d

View File

@ -3340,19 +3340,20 @@ UpnpDownloadXmlDoc( const char *url,
return ret_code;
}
/* TODO: MoNKi: Do not check this?? Some routers (Linksys WRT54GS) sends
"CONTENT-TYPE: application/octet-stream". If the data sended is not
an xml file, ixmlParseBufferEx will fail and the function will return
UPNP_E_INVALID_DESC too.*/
if( strncasecmp( content_type, "text/xml", strlen( "text/xml" ) ) ) {
DBGONLY(
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Not text/xml\n" );
)
// Linksys WRT54G router returns
// "CONTENT-TYPE: application/octet-stream".
// Let's be nice to Linksys and try to parse document anyway.
// If the data sended is not a xml file, ixmlParseBufferEx
// will fail and the function will return UPNP_E_INVALID_DESC too.
#if 0
free( xml_buf );
DBGONLY( UpnpPrintf( UPNP_CRITICAL, API, __FILE__, __LINE__,
"Not text/xml\n" );
)
return UPNP_E_INVALID_DESC;
return UPNP_E_INVALID_DESC;
#endif
}
// end of TODO Do not check this
ret_code = ixmlParseBufferEx( xml_buf, xmlDoc );
free( xml_buf );