Results 1 to 2 of 2

Thread: [Qt bug?] QNetworkReply::setReadBufferSize() and data loss

  1. #1
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Unhappy [Qt bug?] QNetworkReply::setReadBufferSize() and data loss

    I'm having trouble using QNetworkReply::setReadBufferSize().

    When I try to limit the buffer size to throttle down download speed, I get random data loss.
    It always happens at the end of the transmitted content. The first big part of the content is always valid.


    Is it safe to call QNetworkReply::setReadBufferSize() DURING the download?

    I also use multiple QNetworkAccessManagers, but I guess this should not be the cause of the problem.


    I checked the network traffic with Wireshark, and the missing part is there.

    QNetworkReply::bytesAvailable() returns 0, so it looks like I'm reading all available data.


    I don't exclude the possibility that it's just my mistake, but I cannot find it in my code.


    Qt 4.6.3, Debian GNU/Linux 7.0 Wheezy


    EDIT:
    It seems to be a Qt bug.
    The problem occurs when using QNetworkReply::setReadBufferSize() with downloads with unknown content length, i.e. no Content-Length header and downloadProgress()'s bytesTotal == 0.
    On random occasions Qt does not provide the ending part in such cases.
    Last edited by ultr; 7th March 2011 at 20:14.

  2. #2
    Join Date
    Nov 2006
    Location
    Poland
    Posts
    35
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: [Qt bug?] QNetworkReply::setReadBufferSize() and data loss


Similar Threads

  1. Subclassing QNetworkReply
    By piotr.dobrogost in forum Qt Programming
    Replies: 6
    Last Post: 19th December 2010, 08:42
  2. (SOLVED) Data loss over tcp connection?
    By giowck in forum Qt Programming
    Replies: 4
    Last Post: 24th September 2009, 19:04
  3. LocalSocket and Data Loss
    By ManuMies in forum Qt Programming
    Replies: 6
    Last Post: 8th September 2009, 14:32
  4. loss of data recieved using http->readAll()
    By arunredi in forum Qt Programming
    Replies: 5
    Last Post: 26th June 2008, 17:12
  5. Exception type loss
    By azdruid in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2007, 20:06

Tags for this Thread

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.