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

Richard Moore rich at kde.org
Thu Dec 26 18:36:03 CET 2013


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.

Cheers

Rich.



More information about the Development mailing list