Results 1 to 5 of 5

Thread: problem in using QHttp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: problem in using QHttp

    Quote Originally Posted by Ferdous View Post
    That's what I've done here.
    Not really.

    I've queued all the download requests in pendingRequestList and scheduled only one download at a time.
    And that's exactly what happens - you get one download.

    When the first download is finished and the request queue is empty, done(bool) signal is emitted and slot myHttpRequestDone(bool) is called where processNextRequest() is called and it's processNextRequest() where QHttp:get() is called for the next download. So it's not a problem that the condition pendingRequest.size() == 1 is executed only for the first download request.
    Yeah, but after the first download you have two elements in the queue, so the condition size()==1 is not satisfied. Don't you think it should be "!pendingRequest.isEmpty()"?

  2. #2
    Join Date
    Sep 2008
    Location
    Bangladesh
    Posts
    17
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem in using QHttp

    Quote Originally Posted by wysota View Post
    And that's exactly what happens - you get one download.
    When one download completes, processNextRequest() is called. So shouldn't the download for next request in pendingRequestList continue successfully?

    Yeah, but after the first download you have two elements in the queue, so the condition size()==1 is not satisfied. Don't you think it should be "!pendingRequest.isEmpty()"?
    pendingRequestList.size() == 1 condition is meant for only the first download request so that only the first download request gets chance to call processNextRequest as soon as it arrives, for other requests, they are put in the pendingRequestList. When the first download completes, QHttp::done(bool) signal is emitted and slot myHttpRequestDone(bool) gets called. At the end of myHttpRequestDone(bool) function, processNextRequest() is called and now the first request in the current list gets chance to start download by get().

    This is my logic to solve the problem - downloading multiple files. But I've failed so far.

    Hope I've been able to make you understand my viewpoint.

Similar Threads

  1. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  2. QHttp download file problem.
    By fengtian.we in forum Qt Programming
    Replies: 12
    Last Post: 12th June 2007, 09:39
  3. Problem : use QHttp get a file to QFile
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 24th May 2007, 10:58
  4. QHttp Problem
    By musaulker in forum Newbie
    Replies: 4
    Last Post: 29th March 2007, 00:40
  5. QHttp "PUT METHOD" QT Problem File Upload. RFC 2616
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 25th October 2006, 22:02

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
  •  
Qt is a trademark of The Qt Company.