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

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri Dec 27 18:41:31 CET 2013


On Thu, Dec 26, 2013 at 11:06 PM, Richard Moore <rich at kde.org> wrote:
> On 26 December 2013 17:10, Mandeep Sandhu <mandeepsandhu.chd at gmail.com> wrote:
>> On Thu, Dec 26, 2013 at 8:12 PM, Richard Moore <rich at kde.org> wrote:
>>> On 26 December 2013 13:11, Thiago Macieira <thiago.macieira at intel.com> wrote:
>>>> On quinta-feira, 26 de dezembro de 2013 18:15:56, Mandeep Sandhu wrote:
>>>>> We could emit download progress for each intermediate request, but
>>>>> won't that look strange to a user as the bytes received & _possibly_
>>>>> bytes total values will keep changing across these requests? Or is
>>>>> that acceptable given the user knows that we're making multiple
>>>>> requests on its behalf?
>>>>
>>>> There is no downloadProgress for any intermediate requests. We know that we're
>>>> redirecting before we get the first byte of data out of the server. At that
>>>> point, we can abandon the QHttpNetworkReply and move on to the next already.
>>>
>>> Hmm true, though we'll have to make sure we read any body provided
>>> rather than just abandon the request or we can't reuse the connection.
>>
>> Reuse of connection will also depend on where we're being redirected
>> to. If it's a different domain/server altogether then we'll have to
>> make a new connection (eg: how URL shortening services work).
>
> That's true, but misses the point. We retain and reuse connections (up
> to 6 per server). We might well end up using a new one (or reusing an
> old one) after a redirect but we can't leave the original one in an
> inconsistent state. For example, if a page links to 10 images and each
> image request is actually a redirect to where the image really lives
> then we'd reuse the connections to the first server for the later
> image requests.

Got it. If there's some content in the 'body' part of the response and
it points to the same server which sent a redirect, then we could
reuse the existing connection.

Though it might be a rare case where the redirects will have a 'body'
associated with it. I've mostly seen redirects used by URL shortening
services and CDNs where there's no body in the redirect resp. CMIIW.

Thanks,
-mandeep

>
> Cheers
>
> Rich.



More information about the Development mailing list