Review Request 126865: kio_http: fix waiting until the cache cleaner listens to the socket.

David Faure faure at kde.org
Wed Jan 27 07:45:04 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126865/
-----------------------------------------------------------

(Updated Jan. 27, 2016, 7:45 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Frameworks and Andreas Hartmetz.


Repository: kio


Description
-------

The old code was doing connectToServer+waitForConnected, but this
fails immediately if connectToServer sets an error like QLocalSocket::ConnectionRefusedError.
waitForConnected() is only meaningful if we are in ConnectingState.

We do have to try multiple times (no way to wait until precisely
the time when it start listening), but not using waitForConnected,
so I used msleep(100) in the loop instead.

I could have used DBus activation of course (to block until it's ready),
but I assume DBus is not wanted here since that's not what's used for
communication in the first place.

Change-Id: Ib9ee4699a44daa3016a72a24c6e816b940e1ed5c


Diffs
-----

  src/ioslaves/http/http.cpp 76da711cbb3eee9ba801a6e8117d78aaee467626 

Diff: https://git.reviewboard.kde.org/r/126865/diff/


Testing
-------

kill kio_http_cache_cleaner; run unittest using KIO::get; watch kio_http output.

Before:
HTTPProtocol::sendCacheCleanerCommand: Could not connect to cache cleaner, not updating stats of this cache file.

After:
HTTPProtocol::sendCacheCleanerCommand: Successfully connected to cache cleaner.


Thanks,

David Faure

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160127/df504fe2/attachment.html>


More information about the Kde-frameworks-devel mailing list