]> git.sesse.net Git - vlc/commitdiff
upnp: Switch to an unlimited maximum content length
authorMirsal Ennaime <mirsal@videolan.org>
Tue, 20 Dec 2011 07:34:45 +0000 (08:34 +0100)
committerMirsal Ennaime <mirsal@videolan.org>
Tue, 20 Dec 2011 07:38:54 +0000 (08:38 +0100)
Use INT_MAX as the maximum content length as libupnp introduced 0 as an
unlimited content length in pupnp 1.6.7, though UPNP_VERSION was not bumped.

modules/services_discovery/upnp.cpp

index 075c9dd8bcfbb01752cc77d6ed985c00980832f1..84cf3c45768f1abcbf7997ae36feba9a1eade9a3 100644 (file)
@@ -136,6 +136,18 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    /* libupnp does not treat a maximum content length of 0 as unlimited
+     * until 64dedf (~ pupnp v1.6.7) and provides no sane way to discriminate
+     * between versions */
+    if( (i_res = UpnpSetMaxContentLength( INT_MAX )) != UPNP_E_SUCCESS )
+    {
+        msg_Err( p_sd, "Failed to set maximum content length: %s",
+                UpnpGetErrorMessage( i_res ));
+
+        Close( (vlc_object_t*) p_sd );
+        return VLC_EGENERIC;
+    }
+
     return VLC_SUCCESS;
 }