[vlc-commits] demux: adaptive: debug HTTP/HTTPS error

Zhao Zhili git at videolan.org
Tue Sep 12 15:38:46 CEST 2017


vlc | branch: master | Zhao Zhili <wantlamy at gmail.com> | Tue Sep 12 13:46:47 2017 +0800| [ce89751a63e18543dadf28ab092c845d5a836927] | committer: Francois Cartegnie

demux: adaptive: debug HTTP/HTTPS error

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce89751a63e18543dadf28ab092c845d5a836927
---

 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 74d2103438..72775baaee 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;
     }
 



More information about the vlc-commits mailing list