kio_http: fix waiting until the cache cleaner listens to the socket.
Review Request #126865 - Created Jan. 23, 2016 and submitted
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
kill kio_http_cache_cleaner; run unittest using KIO::get; watch kio_http output.
HTTPProtocol::sendCacheCleanerCommand: Could not connect to cache cleaner, not updating stats of this cache file.
HTTPProtocol::sendCacheCleanerCommand: Successfully connected to cache cleaner.
Yeah... I guess what happened under regular use was that the first request by the first ioslave started and then failed to connect to the cache cleaner. The cache cleaner then became ready and started to get used after a few requests or so.