[vlc-devel] patch to DASH to fix compatibility with com.sun.net.httpserver
Robert Forsman
bob.forsman at ericsson.com
Wed May 2 00:04:14 CEST 2012
modules/stream_filter/dash/http/HTTPConnection.cpp was case-sensitive
when checking Content-Length. RFC 2616 section 4.2 states "Field names
are case-insensitive"
The http server built in to the JDK 1.6 uses a field name of
"Content-length" which reveals an incompatibility of VLC's DASH module.
The following patch fixes that specific header parsing.
diff --git a/modules/stream_filter/dash/http/HTTPConnection.cpp b/modules/stream_filter/dash/http/HTTPConnection.cpp
index 8fbda43..dbe9fa5 100644
--- a/modules/stream_filter/dash/http/HTTPConnection.cpp
+++ b/modules/stream_filter/dash/http/HTTPConnection.cpp
@@ -119,7 +119,7 @@ bool HTTPConnection::parseHeader ()
while(line.compare("\r\n"))
{
- if(!line.compare(0, 14, "Content-Length"))
+ if(0==strncasecmp(line.c_str(), "Content-Length", 14))
this->contentLength = atoi(line.substr(15,line.size()).c_str());
line = this->readLine();
More information about the vlc-devel
mailing list