Results 1 to 3 of 3

Thread: QNetworkReply::uploadProgress finishes immediately

  1. #1
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QNetworkReply::uploadProgress finishes immediately

    I am using QNetworkAccessManager:ost to upload files to a webserver, and everything is working except QNetworkReply::uploadProgress returns almost instantly that the upload has finished when in fact it is far from finished. There seems to be a bug when using HTTPS http://qt.nokia.com/developer/task-t...ntry&id=249585, although I am using HTTP. Any insight would be helpful, Thanks.

  2. #2
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkReply::uploadProgress finishes immediately

    Did some more research and found this on the Qt-interest list. http://lists.trolltech.com/pipermail...er/012265.html

    > 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
    Can anyone confirm if this bug has been fixed? I can't find any information about it. BTW I am using 4.6.0.

  3. #3
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkReply::uploadProgress finishes immediately

    Still have not been able to find out what is going on. Something else I have observed is occasionally when starting an upload the progress will jump to what seems like a random percentage e.g. (81%) then wait for the actual upload to catch up and continue on seemingly normal, though this only seems to happen for the first upload if you start multiple, and it is not reliably repeatable.

Similar Threads

  1. Replies: 2
    Last Post: 7th January 2010, 09:52
  2. QSslSocket based server never finishes handshake (Solved)
    By December in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2009, 14:15
  3. [+] does not show up immediately
    By yuriry in forum Qt Programming
    Replies: 4
    Last Post: 4th October 2008, 19:14
  4. Dialog closes immediately
    By bruccutler in forum Qt Programming
    Replies: 5
    Last Post: 21st February 2007, 23:18
  5. forcing QResizeEvent to come immediately
    By tpomorsk in forum Qt Programming
    Replies: 5
    Last Post: 14th September 2006, 16:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.