More miscellaneous UPnP fixes.

This commit is contained in:
Josh Elsasser 2006-09-28 02:27:42 +00:00
parent ab661c6dc9
commit 6fd43ab22b
1 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,7 @@
#define LOOP_DETECT_THRESHOLD 10 /* error on 10 add/get/del state changes */ #define LOOP_DETECT_THRESHOLD 10 /* error on 10 add/get/del state changes */
#define MAPPING_CHECK_INTERVAL 900000 /* 15 minutes */ #define MAPPING_CHECK_INTERVAL 900000 /* 15 minutes */
#define HTTP_REQUEST_INTERVAL 500 /* half a second */ #define HTTP_REQUEST_INTERVAL 500 /* half a second */
#define SOAP_METHOD_NOT_ALLOWED 405
#define IGD_GENERIC_ERROR 500 #define IGD_GENERIC_ERROR 500
#define IGD_GENERIC_FAILED 501 #define IGD_GENERIC_FAILED 501
#define IGD_NO_MAPPING_EXISTS 714 #define IGD_NO_MAPPING_EXISTS 714
@ -835,6 +836,7 @@ devicePulseGetHttp( tr_upnp_device_t * dev, tr_fd_t * fdlimit )
return NULL; return NULL;
} }
ret = NULL;
switch( dev->state ) switch( dev->state )
{ {
case UPNPDEV_STATE_ROOT: case UPNPDEV_STATE_ROOT:
@ -936,7 +938,7 @@ devicePulseHttp( tr_upnp_device_t * dev, tr_fd_t * fdlimit,
{ {
case TR_OK: case TR_OK:
code = tr_httpResponseCode( headers, hlen ); code = tr_httpResponseCode( headers, hlen );
if( TR_HTTP_STATUS_FAIL( code ) && !dev->soapretry ) if( SOAP_METHOD_NOT_ALLOWED == code && !dev->soapretry )
{ {
dev->soapretry = 1; dev->soapretry = 1;
killHttp( fdlimit, &dev->http ); killHttp( fdlimit, &dev->http );
@ -1228,7 +1230,7 @@ soapRequest( int retry, const char * host, int port, const char * path,
} }
tr_httpAddBody( http, tr_httpAddBody( http,
"<s:Envelope" "<s:Envelope"
" xmlns:s=\"" SOAP_ENVELOPE "'\"" " xmlns:s=\"" SOAP_ENVELOPE "\""
" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" " s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
" <s:Body>" " <s:Body>"
" <u:%s xmlns:u=\"" UPNP_SERVICE_TYPE "\">", action->name ); " <u:%s xmlns:u=\"" UPNP_SERVICE_TYPE "\">", action->name );