mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-05 20:02:19 +03:00
body_size: Support configuration of max supported body size for RFC7959
Function coap_context_set_max_body_size() added. For servers, if body size is too large, a 4.13 response is generated. For clients, if the body size is too large, the server gets a RST and no date is passed to the application. A new event COAP_EVENT_BLOCK_ISSUE is generated.
This commit is contained in:
1 parent
6c0be0c898
commit
07c7a7aa57
13 files changed
+150
-9
No files matched your search
@@ -371,6 +371,7 @@ event_handler(coap_session_t *session COAP_UNUSED,
|
||||
case COAP_EVENT_WS_PACKET_SIZE:
|
||||
case COAP_EVENT_WS_CLOSED:
|
||||
case COAP_EVENT_BAD_PACKET:
|
||||
case COAP_EVENT_BLOCK_ISSUE:
|
||||
quit = 1;
|
||||
break;
|
||||
case COAP_EVENT_FIRST_PDU_FAIL:
|
||||
@@ -402,6 +403,8 @@ event_handler(coap_session_t *session COAP_UNUSED,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (quit)
|
||||
coap_send_recv_terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1117,6 +1117,7 @@ proxy_event_handler(coap_session_t *session COAP_UNUSED,
|
||||
case COAP_EVENT_SESSION_FAILED:
|
||||
case COAP_EVENT_PARTIAL_BLOCK:
|
||||
case COAP_EVENT_XMIT_BLOCK_FAIL:
|
||||
case COAP_EVENT_BLOCK_ISSUE:
|
||||
case COAP_EVENT_SERVER_SESSION_NEW:
|
||||
case COAP_EVENT_SERVER_SESSION_DEL:
|
||||
case COAP_EVENT_SERVER_SESSION_CONNECTED:
|
||||
|
||||
Reference in new issue
Block a user