mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Return correct error code when RTSP receive times out
This commit is contained in:
parent
25528671d2
commit
49fd1bed3f
@ -243,11 +243,19 @@ static int transactRtspMessageTcp(PRTSP_MESSAGE request, PRTSP_MESSAGE response,
|
||||
offset = 0;
|
||||
for (;;) {
|
||||
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
|
||||
break;
|
||||
}
|
||||
offset += err;
|
||||
else {
|
||||
offset += err;
|
||||
}
|
||||
|
||||
// Warn if the RTSP message is too big
|
||||
if (offset == RTSP_MAX_RESP_SIZE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user