[Development] Proposal for allowing handling of HTTP redirects in QNAM

Richard Moore rich at kde.org
Mon Dec 30 17:36:22 CET 2013


On 30 December 2013 16:07, Mandeep Sandhu <mandeepsandhu.chd at gmail.com> wrote:
>>>> So I guess having body in the 3xx response will not be all that unusual.
>>>
>>> It will be.
>>
>> Actually, it's extremely common - here's a default apache 301 for example:

[snip]
> I guess the body is provided for clients who can't or intentionally
> won't, do a HTTP redirect. In that case the message in the body is
> shown to the user to do a manual redirect.

Yes

>
> In any case, coming back to the original question, how should the
> downloadProgress signal behave? Have it reset each time on a redirect
> (as the total bytes can possibly change across redirects)?

Since we know immediately that we're being redirected we can simply
wait until we get a non-redirecting response before we start emitting
the progress signals. We just need to (internally) ensure that we've
read the body from the redirect response, the user of QNAM doesn't
need to care.

Cheers

Rich.

>
> I guess this is also the only way to do it as we don't know in advance
> how many redirects are going to happen and what content they may
> carry.
>
> -mandeep
>
>>
>> Cheers
>>
>> Rich.
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list