[Qt-interest] QNetworkReply

Thiago Macieira thiago.macieira at trolltech.com
Wed Sep 2 20:17:50 CEST 2009


Em Quarta-feira 02 Setembro 2009, às 18:22:43, Info escreveu:
> Hi,
> 
> Does anyone use QNetworkAccessManager and QNetworkReply? I've some odd
> behaviour with them in that the uploadProgress() event is fired and
> has no real baring on the actual progress of the upload. 

That's a bug and has been fixed.

I don't remember if we could fix it for the 4.5.x series, though. I'm certain 
it's fixed for the upcoming 4.6.0.

What happens is that the QNetworkReply class emits the signal when it writes 
to its backend (the private QHttpNetworkConnection class). However, since 
QTcpSocket's outgoing buffer is not bounded, QHttpNetworkConnection ends up 
transferring all bytes from your source data directly into the socket buffer. 
So we buffer everything in memory and then send as fast as the kernel socket 
can send.

The fix was to control the buffer size and stop reading from the user once we 
reach a certain threshold.
-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Development Frameworks
     Sandakerveien 116, NO-0402 Oslo, Norway

Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
      http://qt.nokia.com/qtdevdays2009
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090902/ba153a3a/attachment.bin 


More information about the Qt-interest-old mailing list