Fix: Return correct error code for create_relay_connection in case of RESERVATION-TOKEN failure (#1319)

Fixes #1266 

According to RFC 5766, [section 6.2](https://www.rfc-editor.org/rfc/rfc5766#section-6.2) point no. 5, the turn server needs to reject the request with 508 (Insufficient Capacity) error code when the given RESERVATION-TOKEN is not valid.
This commit is contained in:
Subhra264 2023-11-23 10:00:27 +05:30 committed by GitHub
parent 4353f05021
commit 9485c9567e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4241,7 +4241,7 @@ static int create_relay_connection(turn_turnserver *server, ts_ur_super_session
ioa_socket_tobeclosed(s)) {
IOA_CLOSE_SOCKET(s);
*err_code = 404;
*err_code = 508;
*reason = (const uint8_t *)"Cannot find reserved socket";
return -1;
}