diff --git a/qtbase/src/network/socket/qhttpsocketengine.cpp b/qtbase/src/network/socket/qhttpsocketengine.cpp
index dfeb8c7e..43c25dbd 100644
a
|
b
|
qint64 QHttpSocketEngine::bytesAvailable() const |
229 | 229 | qint64 QHttpSocketEngine::read(char *data, qint64 maxlen) |
230 | 230 | { |
231 | 231 | Q_D(QHttpSocketEngine); |
| 232 | if (!d->socket) { |
| 233 | setError(QAbstractSocket::OperationError, |
| 234 | QLatin1String("TCP socket not connected")); |
| 235 | setState(QAbstractSocket::UnconnectedState); |
| 236 | return -1; |
| 237 | } |
232 | 238 | qint64 bytesRead = d->socket->read(data, maxlen); |
233 | 239 | |
234 | 240 | if (d->socket->state() == QAbstractSocket::UnconnectedState |
… |
… |
qint64 QHttpSocketEngine::read(char *data, qint64 maxlen) |
252 | 258 | qint64 QHttpSocketEngine::write(const char *data, qint64 len) |
253 | 259 | { |
254 | 260 | Q_D(QHttpSocketEngine); |
255 | | return d->socket->write(data, len); |
| 261 | if (d->socket) { |
| 262 | return d->socket->write(data, len); |
| 263 | } else { |
| 264 | setError(QAbstractSocket::OperationError, |
| 265 | QLatin1String("TCP socket not connected")); |
| 266 | setState(QAbstractSocket::UnconnectedState); |
| 267 | return -1; |
| 268 | } |
256 | 269 | } |
257 | 270 | |
258 | 271 | #ifndef QT_NO_UDPSOCKET |