Commit f0bf3522 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf
Browse files

dash: Avoid some copies.


Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f4600d0e
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
using namespace dash::http; using namespace dash::http;
HTTPConnection::HTTPConnection (std::string url, stream_t *stream) HTTPConnection::HTTPConnection (const std::string& url, stream_t *stream)
{ {
this->url = url; this->url = url;
this->stream = stream; this->stream = stream;
...@@ -107,7 +107,7 @@ std::string HTTPConnection::readLine () ...@@ -107,7 +107,7 @@ std::string HTTPConnection::readLine ()
return "\r\n"; return "\r\n";
} }
bool HTTPConnection::sendData (std::string data) bool HTTPConnection::sendData (const std::string& data)
{ {
ssize_t size = net_Write(this->stream, this->httpSocket, NULL, data.c_str(), data.size()); ssize_t size = net_Write(this->stream, this->httpSocket, NULL, data.c_str(), data.size());
if (size == -1) if (size == -1)
......
...@@ -48,7 +48,7 @@ namespace dash ...@@ -48,7 +48,7 @@ namespace dash
class HTTPConnection : public IHTTPConnection class HTTPConnection : public IHTTPConnection
{ {
public: public:
HTTPConnection (std::string url, stream_t *stream); HTTPConnection ( const std::string& url, stream_t *stream );
virtual ~HTTPConnection (); virtual ~HTTPConnection ();
bool init (); bool init ();
...@@ -67,7 +67,7 @@ namespace dash ...@@ -67,7 +67,7 @@ namespace dash
stream_t *urlStream; stream_t *urlStream;
void parseURL (); void parseURL ();
bool sendData (std::string data); bool sendData (const std::string& data);
bool parseHeader (); bool parseHeader ();
std::string readLine (); std::string readLine ();
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment