[vlc-commits] adaptive: httpconnection: use object instead of stream

Francois Cartegnie git at videolan.org
Thu Feb 25 23:00:44 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Feb 21 14:54:26 2016 +0100| [fbb15a4a8bd96c30fdfbc4e94a4467778cb72f7a] | committer: Francois Cartegnie

adaptive: httpconnection: use object instead of stream

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

 modules/demux/adaptive/http/HTTPConnection.cpp |   16 ++++++++--------
 modules/demux/adaptive/http/HTTPConnection.hpp |    2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/demux/adaptive/http/HTTPConnection.cpp b/modules/demux/adaptive/http/HTTPConnection.cpp
index 9ffb79c..dac1621 100644
--- a/modules/demux/adaptive/http/HTTPConnection.cpp
+++ b/modules/demux/adaptive/http/HTTPConnection.cpp
@@ -26,11 +26,11 @@
 
 using namespace adaptive::http;
 
-HTTPConnection::HTTPConnection(vlc_object_t *stream_, Socket *socket_, bool persistent)
+HTTPConnection::HTTPConnection(vlc_object_t *p_object_, Socket *socket_, bool persistent)
 {
     socket = socket_;
-    stream = stream_;
-    psz_useragent = var_InheritString(stream, "http-user-agent");
+    p_object = p_object_;
+    psz_useragent = var_InheritString(p_object, "http-user-agent");
     bytesRead = 0;
     contentLength = 0;
     queryOk = false;
@@ -55,7 +55,7 @@ bool HTTPConnection::compare(const std::string &hostname, uint16_t port, int typ
 
 bool HTTPConnection::connect(const std::string &hostname, uint16_t port)
 {
-    if(!socket->connect(stream, hostname.c_str(), port))
+    if(!socket->connect(p_object, hostname.c_str(), port))
         return false;
 
     this->hostname = hostname;
@@ -82,7 +82,7 @@ int HTTPConnection::query(const std::string &path, const BytesRange &range)
 {
     queryOk = false;
 
-    msg_Dbg(stream, "Retrieving ://%s:%u%s @%zu", hostname.c_str(), port, path.c_str(),
+    msg_Dbg(p_object, "Retrieving ://%s:%u%s @%zu", hostname.c_str(), port, path.c_str(),
             range.isValid() ? range.getStartByte() : 0);
 
     if(!connected() && ( hostname.empty() || !connect(hostname, port) ))
@@ -145,7 +145,7 @@ ssize_t HTTPConnection::read(void *p_buffer, size_t len)
     if(len > toRead)
         len = toRead;
 
-    ssize_t ret = socket->read(stream, p_buffer, len);
+    ssize_t ret = socket->read(p_object, p_buffer, len);
     if(ret >= 0)
         bytesRead += ret;
 
@@ -165,7 +165,7 @@ bool HTTPConnection::send(const std::string &data)
 
 bool HTTPConnection::send(const void *buf, size_t size)
 {
-    return socket->send(stream, buf, size);
+    return socket->send(p_object, buf, size);
 }
 
 int HTTPConnection::parseReply()
@@ -204,7 +204,7 @@ int HTTPConnection::parseReply()
 
 std::string HTTPConnection::readLine()
 {
-    return socket->readline(stream);
+    return socket->readline(p_object);
 }
 
 bool HTTPConnection::isAvailable() const
diff --git a/modules/demux/adaptive/http/HTTPConnection.hpp b/modules/demux/adaptive/http/HTTPConnection.hpp
index 5364b07..d79987d 100644
--- a/modules/demux/adaptive/http/HTTPConnection.hpp
+++ b/modules/demux/adaptive/http/HTTPConnection.hpp
@@ -70,7 +70,7 @@ namespace adaptive
                 std::string hostname;
                 uint16_t port;
                 char * psz_useragent;
-                vlc_object_t *stream;
+                vlc_object_t *p_object;
                 size_t bytesRead;
                 size_t contentLength;
                 BytesRange bytesRange;



More information about the vlc-commits mailing list