Results 1 to 6 of 6

Thread: Very strange (perhaps) QHttp behaviour.

  1. #1
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Question Very strange (perhaps) QHttp behaviour.

    Hi, I have a strange problem and want to ask if someone here has an idea.

    I am writing a program, which watches using the QFilesystemWatcher a watcher folder.
    When another release folder is added to my watcher folder, a .torrent file is automatically created, then a mime object is created and uploaded to a tracker site using http POST.

    This works perfectly well for releases of any size when I add the release folder in the watcher folder manually. However, when the folder is added via an ftp transfer, it works only for small releases (~5mb). For larger releases I have a problem, for which I have no explanation.

    1. The .torrent is created correctly, so the filesystem watcher fires in case of an ftp transfer as good as when I add the files manually.

    2. As far as I can tell, my mime object is also the same.

    3. However, when I do a QHttp::request(<header>,<mime>,0) nothing happens. The QHttp::request returns at once, since it is non-blocking, but no transfer starts. Not a single QHttp signal is emitted. Regardless where I look, not a single trace of an executed QHttp::request can be found. Neither on the local, nor on the remote server. If I had not put debug output before and after the QHttp::request, I would have said, this method as never been called. But it has.

    I am using 4.4.0 on Linux. Any ideas? Anyone experienced something similar?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Very strange (perhaps) QHttp behaviour.

    Maybe the file has not yet complete writing itself and hence cannot be opened for reading and thus QHttp fails?

  3. #3
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Very strange (perhaps) QHttp behaviour.

    Quote Originally Posted by wysota View Post
    Maybe the file has not yet complete writing itself and hence cannot be opened for reading and thus QHttp fails?
    Very unlikely. When I experimented with mime and POST I made several mistakes before I figured out how this worked. I always got more or less comprehensible error responses from the site I contacted. It happened not even once that a request was just 'swallowed'.

    Furthermore the .torrent is created and can be uploaded manually. So the release was complete. The .torrent creation is a synchronous process. No way that I start creating the mime object before the .torrent creation is completed.

    The whole behaviour is strange.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Very strange (perhaps) QHttp behaviour.

    Could you prepare a minimal compilable example reproducing the problem?

  5. #5
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Very strange (perhaps) QHttp behaviour.

    Quote Originally Posted by wysota View Post
    Could you prepare a minimal compilable example reproducing the problem?
    Nope, this would be the whole program. And I cannot release this to the public. But even if I could, it would be quite an effort to reproduce the necessary running environment.

    Actually I did not expect direct debug help, this is more or less impossible. I just hoped someone experienced a similar problem or might have an idea where to look.

  6. #6
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Unhappy Re: Very strange (perhaps) QHttp behaviour.

    Little update. I was able to locate the problem. It is not QHttp. It is the QFileSystemWatcher. When I move the files manually, I get the expected number of signals fired. When the files are added using ftp transfer, it somehow enters an endless loop. Even when the transfer is long finished, nobody touches anything in the watched folder, I get a very fast and constant stream of directoryChanged( const QString & path ) signals.

    Not nice, but to find a workaround is easy.

Similar Threads

  1. qinputdialog strange behaviour
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2008, 19:29
  2. Expanding textedit field strange behaviour
    By vieraci in forum Qt Programming
    Replies: 22
    Last Post: 26th October 2007, 08:08
  3. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 17:38
  4. Replies: 1
    Last Post: 26th February 2006, 05:52
  5. [Qt 4.1] Strange behaviour with QTableView
    By fane in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 06:17

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.