aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io/channel-websock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 7fd6bb6..ec48a30 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -499,9 +499,12 @@ static int qio_channel_websock_handshake_read(QIOChannelWebsock *ioc,
error_setg(errp,
"End of headers not found in first 4096 bytes");
return 1;
- } else {
- return 0;
+ } else if (ret == 0) {
+ error_setg(errp,
+ "End of headers not found before connection closed");
+ return -1;
}
+ return 0;
}
*handshake_end = '\0';