mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 22:31:21 +00:00
Return correct error code when RTSP receive times out
This commit is contained in:
+10
-2
@@ -243,11 +243,19 @@ static int transactRtspMessageTcp(PRTSP_MESSAGE request, PRTSP_MESSAGE response,
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
err = recv(sock, &responseBuffer[offset], RTSP_MAX_RESP_SIZE - offset, 0);
|
err = recv(sock, &responseBuffer[offset], RTSP_MAX_RESP_SIZE - offset, 0);
|
||||||
if (err <= 0) {
|
if (err < 0) {
|
||||||
|
// Error reading
|
||||||
|
*error = LastSocketError();
|
||||||
|
Limelog("Failed to read RTSP response: %d\n", *error);
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
else if (err == 0) {
|
||||||
// Done reading
|
// Done reading
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
offset += err;
|
else {
|
||||||
|
offset += err;
|
||||||
|
}
|
||||||
|
|
||||||
// Warn if the RTSP message is too big
|
// Warn if the RTSP message is too big
|
||||||
if (offset == RTSP_MAX_RESP_SIZE) {
|
if (offset == RTSP_MAX_RESP_SIZE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user