QSocks5SocketEngine: pass data to application when connected

If we end up in the connected state then we should pass on any
remaining data immediately instead of waiting until the next time we get
a read notification.

The other `case`s in the switch might be able to do something similar,
but I don't want to introduce that logic now in case it breaks something
else, the Connected branch is small and simple to deal with.

Should severely reduce flakiness with socks proxy in CI under pressure.

Task-number: QTBUG-76367
Change-Id: I0965d4c62a29a25ce6b8dd60862a464279aef0b4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
This commit is contained in:
Mårten Nordheim 2019-06-21 13:02:34 +02:00
parent cee5a11bdb
commit 5e0a45e932

View File

@ -1188,6 +1188,8 @@ void QSocks5SocketEnginePrivate::_q_controlSocketReadNotification()
break;
case RequestMethodSent:
parseRequestMethodReply();
if (socks5State == Connected && data->controlSocket->bytesAvailable())
_q_controlSocketReadNotification();
break;
case Connected: {
QByteArray buf;