Skip to content

Commit 6cf7721

Browse files
committed
Remove RSVs from public API
These are only used by extensions, which are not currently supported. So just remove them. Keeping them here will only prevent us from supporting extensions in the future.
1 parent ea32147 commit 6cf7721

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

include/aws/http/websocket.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ struct aws_websocket_incoming_frame {
8282
uint64_t payload_length;
8383
uint8_t opcode;
8484
bool fin;
85-
bool rsv[3];
8685
};
8786

8887
/**
@@ -309,7 +308,7 @@ typedef void(
309308
/**
310309
* Options for sending a websocket frame.
311310
* This structure is copied immediately by aws_websocket_send().
312-
* For descriptions of opcode, fin, rsv, and payload_length see in RFC-6455 Section 5.2.
311+
* For descriptions of opcode, fin, and payload_length see in RFC-6455 Section 5.2.
313312
*/
314313
struct aws_websocket_send_frame_options {
315314
/**
@@ -346,11 +345,6 @@ struct aws_websocket_send_frame_options {
346345
* Indicates that this is the final fragment in a message. The first fragment MAY also be the final fragment.
347346
*/
348347
bool fin;
349-
350-
/**
351-
* MUST be 0 unless an extension is negotiated that defines meanings for non-zero values.
352-
*/
353-
bool rsv[3];
354348
};
355349

356350
AWS_EXTERN_C_BEGIN

source/websocket.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,9 +1291,6 @@ static int s_decoder_on_frame(const struct aws_websocket_frame *frame, void *use
12911291
websocket->thread_data.current_incoming_frame->payload_length = frame->payload_length;
12921292
websocket->thread_data.current_incoming_frame->opcode = frame->opcode;
12931293
websocket->thread_data.current_incoming_frame->fin = frame->fin;
1294-
websocket->thread_data.current_incoming_frame->rsv[0] = frame->rsv[0];
1295-
websocket->thread_data.current_incoming_frame->rsv[1] = frame->rsv[1];
1296-
websocket->thread_data.current_incoming_frame->rsv[2] = frame->rsv[2];
12971294

12981295
/* If CONTINUATION frames are expected, remember which type of data is being continued.
12991296
* RFC-6455 Section 5.4 Fragmentation */

tests/test_websocket_handler.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ static int s_readpush_check(struct tester *tester, size_t frame_i, int expected_
377377
ASSERT_UINT_EQUALS(pushed->def.payload_length, received->def.payload_length);
378378
ASSERT_UINT_EQUALS(pushed->def.opcode, received->def.opcode);
379379
ASSERT_INT_EQUALS(pushed->def.fin, received->def.fin);
380-
ASSERT_INT_EQUALS(pushed->def.rsv[0], received->def.rsv[0]);
381-
ASSERT_INT_EQUALS(pushed->def.rsv[1], received->def.rsv[1]);
382-
ASSERT_INT_EQUALS(pushed->def.rsv[2], received->def.rsv[2]);
383380

384381
if (received->on_complete_error_code == AWS_ERROR_SUCCESS) {
385382
ASSERT_UINT_EQUALS(received->def.payload_length, received->payload.len);
@@ -621,9 +618,6 @@ static int s_check_written_message(struct send_tester *send, size_t expected_ord
621618
ASSERT_UINT_EQUALS(send->def.opcode, written->def.opcode);
622619
ASSERT_UINT_EQUALS(send->def.payload_length, written->def.payload_length);
623620
ASSERT_INT_EQUALS(send->def.fin, written->def.fin);
624-
for (int i = 0; i < 3; i++) {
625-
ASSERT_INT_EQUALS(send->def.rsv[i], written->def.rsv[i]);
626-
}
627621

628622
/* All payloads sent from client should have been masked (assuming client is being tested here) */
629623
ASSERT_TRUE(written->def.masked);

0 commit comments

Comments
 (0)