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

Thomas Brouckaert thomasbrouckaert at gmail.com
Fri Apr 6 13:11:58 CEST 2012


Hello Frederic,

In the first case it are all strings so you can use + without any problems.
In the second case he also adds integers to the string, then the + operator
doesnt work ...

Thomas

On Fri, Apr 6, 2012 at 11:10, Frederic YHUEL <fyhuel at viotech.net> wrote:

> 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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120406/c44fee20/attachment.html>


More information about the vlc-devel mailing list