[vlc-devel] [vlc-commits] dash: added Persistent Connection

Frederic YHUEL fyhuel at viotech.net
Fri Apr 6 11:10:53 CEST 2012


Hello,

On Tue, Mar 20, 2012 at 3:14 PM, Christopher Mueller <git at videolan.org> wrote:
> vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Fri Mar  9 16:21:50 2012 +0100| [eb5ab7ff522fd661a73c5f557f5595b35d2ace40] | committer: Hugo Beauzée-Luyssen
>
> dash: added Persistent Connection

>> +std::string         PersistentConnection::prepareRequest    (Chunk *chunk)
> +{
> +    std::string request;
> +    if(!chunk->useByteRange())
> +    {
> +        request = "GET "    + chunk->getPath()     + " HTTP/1.1" + "\r\n" +
> +                  "Host: "  + chunk->getHostname() + "\r\n\r\n";
> +    }

You use a string here.

> +    else
> +    {
> +        std::stringstream req;
> +        req << "GET " << chunk->getPath() << " HTTP/1.1\r\n" <<
> +               "Host: " << chunk->getHostname() << "\r\n" <<
> +               "Range: bytes=" << chunk->getStartByte() << "-" << chunk->getEndByte() << "\r\n\r\n";
> +
> +        request = req.str();
> +    }
> +    return request;

Out of curiosity, what's the point of using a stringstream here?

-- 
Frédéric



More information about the vlc-devel mailing list