equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
8 ** |
8 ** |
776 if (readBytes == 0 && d->socketType == QAbstractSocket::TcpSocket) { |
776 if (readBytes == 0 && d->socketType == QAbstractSocket::TcpSocket) { |
777 d->setError(QAbstractSocket::RemoteHostClosedError, |
777 d->setError(QAbstractSocket::RemoteHostClosedError, |
778 QNativeSocketEnginePrivate::RemoteHostClosedErrorString); |
778 QNativeSocketEnginePrivate::RemoteHostClosedErrorString); |
779 close(); |
779 close(); |
780 return -1; |
780 return -1; |
|
781 } else if (readBytes == -1) { |
|
782 if (!d->hasSetSocketError) { |
|
783 d->hasSetSocketError = true; |
|
784 d->socketError = QAbstractSocket::NetworkError; |
|
785 d->socketErrorString = qt_error_string(); |
|
786 } |
|
787 close(); |
|
788 return -1; |
781 } |
789 } |
782 return readBytes; |
790 return readBytes; |
783 } |
791 } |
784 |
792 |
785 /*! |
793 /*! |