Skip to content

Commit

Permalink
Turn writeXML assert into a qWarning
Browse files Browse the repository at this point in the history
This can happen when the other side closed the socket.

Fixes issue #264
  • Loading branch information
dfaure-kdab committed Nov 2, 2023
1 parent 9a0d1d1 commit 1c01c4d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/KDSoapServer/KDSoapServerSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,13 @@ void KDSoapServerSocket::writeXML(const QByteArray &xmlResponse, bool isFault)
qDebug() << "KDSoapServerSocket: writing" << httpHeaders << xmlResponse;
}
qint64 written = write(httpHeaders);
Q_ASSERT(written == httpHeaders.size()); // Please report a bug if you hit this.
if (written != httpHeaders.size()) {
qWarning() << "Only wrote" << written << "out of" << httpHeaders.size() << "bytes of HTTP headers. Error:" << errorString();
}
written = write(xmlResponse);
Q_ASSERT(written == xmlResponse.size()); // Please report a bug if you hit this.
Q_UNUSED(written);
// flush() ?
if (written != xmlResponse.size()) {
qWarning() << "Only wrote" << written << "out of" << xmlResponse.size() << "bytes of reponse. Error:" << errorString();
}
}

void KDSoapServerSocket::sendReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg)
Expand Down

0 comments on commit 1c01c4d

Please sign in to comment.