Results 1 to 5 of 5

Thread: Progress jump using QNetworkReply and SSL

  1. #1
    Join Date
    Oct 2009
    Posts
    22
    Thanked 1 Time in 1 Post

    Default Progress jump using QNetworkReply and SSL

    Hi,

    Just joined the forums and have a quick question..

    I'm using QNetworkAccessManager to send some large data to a server over SSL/HTTPS and the progress seems to jump forward by a large amount and then stop while the data is uploaded. This does not happen when using standard HTTP. I believe this was supposed to be fixed in 4.5.3 but it doesn't seem to be.

    Does anyone have any ideas on how to get around it and display the progress correctly? Can anyone confirm they are seeing the same behaviour?

    Thanks.

  2. #2
    Join Date
    Oct 2009
    Posts
    37
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Progress jump using QNetworkReply and SSL

    There is a patch for 4.5.x that should fix the issue. Would be nice if you try it and can confirm it works for you: http://pastebin.ca/1629178

    Also try the 4.6 from git or the beta1. It should also work.

    Good luck,
    Markus
    Disclaimer: Although I work on Qt for Nokia, anything I post here is personal

  3. #3
    Join Date
    Oct 2009
    Posts
    22
    Thanked 1 Time in 1 Post

    Default Re: Progress jump using QNetworkReply and SSL

    I can confirm that the patch for 4.5.x works perfectly! Thanks.

    Now, what would be the best way to throttle an upload with QNetworkReply?

  4. #4
    Join Date
    Oct 2009
    Posts
    37
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Progress jump using QNetworkReply and SSL

    Hm. I could think of your upload QIODevice:

    1. be non-sequential (e.g. random-access), else the HTTP upload code will buffer it all before uploading.
    2. Have a timer that resets the upload "quota" and emits readyRead() of the QIODevice
    3. Ever readData() call must only return up to "quota" bytes

    Something like that.
    Disclaimer: Although I work on Qt for Nokia, anything I post here is personal

  5. #5
    Join Date
    Oct 2009
    Posts
    22
    Thanked 1 Time in 1 Post

    Default Re: Progress jump using QNetworkReply and SSL

    After applying the patch to QNetworkAccessManager I'm seeing a crash when aborting the post request. Before the patch, I could abort the upload within the event loop and it would be find, after the patch, aborting causes a crash, details:

    Qt Code:
    1. 0xC0000005: Access violation reading location 0x00000004.
    2.  
    3. QtNetworkd4.dll!QHttpNetworkReply::d_func() Line 146 + 0xa bytes C++
    4. QtNetworkd4.dll!QHttpNetworkConnectionPrivate::sendRequest(QAbstractSocket * socket=0x01947210) Line 395 + 0x15 bytes C++
    5. QtNetworkd4.dll!QHttpNetworkConnectionPrivate::_q_encryptedBytesWritten(__int64 bytes=16421) Line 1374 C++
    6. QtNetworkd4.dll!QHttpNetworkConnection::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=19, void * * _a=0x0160d96c) Line 132 C++
    7. QtCored4.dll!QMetaObject::activate(QObject * sender=0x01947210, int from_signal_index=27, int to_signal_index=27, void * * argv=0x0160d96c) Line 3104 + 0x2b bytes C++
    8. QtCored4.dll!QMetaObject::activate(QObject * sender=0x01947210, const QMetaObject * m=0x640e5ba8, int local_signal_index=4, void * * argv=0x0160d96c) Line 3178 + 0x15 bytes C++
    9. QtNetworkd4.dll!QSslSocket::encryptedBytesWritten(__int64 _t1=16421) Line 155 + 0x15 bytes C++
    10. QtNetworkd4.dll!QSslSocketPrivate::_q_bytesWrittenSlot(__int64 written=16421) Line 2034 C++
    11. QtNetworkd4.dll!QSslSocket::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=16, void * * _a=0x0160da84) Line 115 + 0x1c bytes C++
    12. QtCored4.dll!QMetaObject::activate(QObject * sender=0x019901b0, int from_signal_index=5, int to_signal_index=5, void * * argv=0x0160da84) Line 3104 + 0x2b bytes C++
    13. QtCored4.dll!QMetaObject::activate(QObject * sender=0x019901b0, const QMetaObject * m=0x672b1d38, int local_signal_index=1, void * * argv=0x0160da84) Line 3178 + 0x15 bytes C++
    14. QtCored4.dll!QIODevice::bytesWritten(__int64 _t1=16421) Line 92 + 0x14 bytes C++
    15. QtNetworkd4.dll!QAbstractSocketPrivate::flush() Line 730 C++
    16. QtNetworkd4.dll!QAbstractSocketPrivate::canWriteNotification() Line 650 C++
    17. QtNetworkd4.dll!QAbstractSocketPrivate::writeNotification() Line 78 + 0x15 bytes C++
    18. QtNetworkd4.dll!QAbstractSocketEngine::writeNotification() Line 161 C++
    19. QtNetworkd4.dll!QWriteNotifier::event(QEvent * e=0x0160ded4) Line 1069 C++
    20. QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x01ae7460, QEvent * e=0x0160ded4) Line 4065 + 0x11 bytes C++
    21. QtGuid4.dll!QApplication::notify(QObject * receiver=0x01ae7460, QEvent * e=0x0160ded4) Line 3605 + 0x10 bytes C++
    22. QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x01ae7460, QEvent * event=0x0160ded4) Line 610 + 0x15 bytes C++
    23. QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x01ae7460, QEvent * event=0x0160ded4) Line 213 + 0x39 bytes C++
    24. QtCored4.dll!qt_internal_proc(HWND__ * hwnd=0x005503ca, unsigned int message=1024, unsigned int wp=7220, long lp=2) Line 466 + 0xf bytes C++
    25. user32.dll!_InternalCallWinProc@20() + 0x28 bytes
    26. user32.dll!_UserCallWinProcCheckWow@32() + 0xb7 bytes
    27. user32.dll!_DispatchMessageWorker@8() + 0xdc bytes
    28. user32.dll!_DispatchMessageW@4() + 0xf bytes
    29. QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 751 + 0x17 bytes C++
    30. QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 150 C++
    31. QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 201 + 0x2d bytes C++
    32. QtCored4.dll!QThread::exec() Line 487 + 0x15 bytes C++
    33. NetworkTest.exe!NetworkTest::run() Line 29 C++
    34. QtCored4.dll!QThreadPrivate::start(void * arg=0x00c53520) Line 309 C++
    35. msvcr80d.dll!_callthreadstartex() Line 348 + 0xf bytes C
    36. msvcr80d.dll!_threadstartex(void * ptd=0x00cfcef8) Line 331 C
    37. kernel32.dll!_BaseThreadStart@8() + 0x37 bytes
    To copy to clipboard, switch view to plain text mode 

    Can anyone confirm that this is caused by the patch?

    Thanks

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.