瀏覽代碼

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.
Subhra264 2 年之前
父節點
當前提交
9485c9567e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/server/ns_turn_server.c

+ 1 - 1
src/server/ns_turn_server.c

@@ -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;
       }