Skip to content

Commit b0f7775

Browse files
committed
Set result to failed when timeout
1 parent b9c1a28 commit b0f7775

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/socket/AdapterTls.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ namespace Socket
114114

115115
do {
116116
if (sock.nonblock_recv_sync(timeout) == false) {
117+
// Timeout
118+
result = -1;
117119
break;
118120
}
119121

120122
result = ::gnutls_record_recv(this->session, buf, length);
121123
}
122-
while (GNUTLS_E_AGAIN == result ||GNUTLS_E_INTERRUPTED == result);
124+
while (GNUTLS_E_AGAIN == result || GNUTLS_E_INTERRUPTED == result);
123125

124126
return result;
125127
}

0 commit comments

Comments
 (0)