[vlc-devel] [PATCH 2/2] demux: adaptive: debug HTTP/HTTPS error

Zhao Zhili quinkblack at foxmail.com
Tue Sep 12 07:51:52 CEST 2017


---
  modules/demux/adaptive/http/HTTPConnection.cpp | 15 +++++++--------
  1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/demux/adaptive/http/HTTPConnection.cpp 
b/modules/demux/adaptive/http/HTTPConnection.cpp
index 74d2103..72775ba 100644
--- a/modules/demux/adaptive/http/HTTPConnection.cpp
+++ b/modules/demux/adaptive/http/HTTPConnection.cpp
@@ -217,26 +217,25 @@ bool HTTPConnection::send(const void *buf, size_t 
size)

  int HTTPConnection::parseReply()
  {
-    std::string line = readLine();
+    std::string statusline = readLine();

-    if(line.empty())
+    if(statusline.empty())
          return VLC_EGENERIC;

-    if (line.compare(0, 9, "HTTP/1.1 ")!=0)
+    if (statusline.compare(0, 9, "HTTP/1.1 ")!=0)
      {
-        if(line.compare(0, 9, "HTTP/1.0 ")!=0)
+        if(statusline.compare(0, 9, "HTTP/1.0 ")!=0)
              return VLC_ENOOBJ;
          else
              connectionClose = true;
      }

-    std::istringstream ss(line.substr(9));
+    std::istringstream ss(statusline.substr(9));
      ss.imbue(std::locale("C"));
      int replycode;
      ss >> replycode;

-
-    line = readLine();
+    std::string line = readLine();

      while(!line.empty() && line.compare("\r\n"))
      {
@@ -258,7 +257,7 @@ int HTTPConnection::parseReply()
      }
      else if (replycode != 200 && replycode != 206)
      {
-        msg_Err(p_object, "Failed reading %s: %s", 
params.getUrl().c_str(), line.c_str());
+        msg_Err(p_object, "Failed reading %s: %s", 
params.getUrl().c_str(), statusline.c_str());
          return VLC_ENOOBJ;
      }

-- 
2.7.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-demux-adaptive-debug-HTTP-HTTPS-error.patch
Type: text/x-patch
Size: 1803 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170912/0cd4b622/attachment.bin>


More information about the vlc-devel mailing list