mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-13 03:40:40 +03:00
Client: Remove (D)TLS / WebSocket startup call-back timing window
Add in new functions coap_new_client_session3() coap_new_client_session_pki3() coap_new_client_session_psk3() coap_new_client_session_oscore3() coap_new_client_session_oscore_pki3() coap_new_client_session_oscore_psk3() which effectively does coap_session_set_app_data2() and coap_ws_set_host_request() early on in the session set up cycle.
This commit is contained in:
1 parent
c9135b6b26
commit
d80fa1497d
25 files changed
+918
-212
No files matched your search
@@ -100,7 +100,7 @@ static int coap_client_init(coap_context_t *ctx)
|
||||
}
|
||||
|
||||
if (uri.scheme == COAP_URI_SCHEME_COAP) {
|
||||
session = coap_new_client_session(ctx, NULL, &dst, COAP_PROTO_UDP);
|
||||
session = coap_new_client_session3(ctx, NULL, &dst, COAP_PROTO_UDP, NULL, NULL, NULL);
|
||||
} else if (uri.scheme == COAP_URI_SCHEME_COAP_TCP) {
|
||||
goto fail;
|
||||
} else if (uri.scheme == COAP_URI_SCHEME_COAPS_TCP) {
|
||||
@@ -125,7 +125,7 @@ static int coap_client_init(coap_context_t *ctx)
|
||||
dtls_psk.psk_info.key.s = (const uint8_t *)COAP_USE_PSK;
|
||||
dtls_psk.psk_info.key.length = strlen(COAP_USE_PSK);
|
||||
|
||||
session = coap_new_client_session_psk2(ctx, NULL, &dst, COAP_PROTO_DTLS, &dtls_psk);
|
||||
session = coap_new_client_session_psk3(ctx, NULL, &dst, COAP_PROTO_DTLS, &dtls_psk, NULL, NULL, NULL);
|
||||
#else /* ! COAP_USE_PSK && ! COAP_USE_PSK_ID */
|
||||
coap_log_err("CONFIG_LIBCOAP_USE_PSK and CONFIG_LIBCOAP_USE_PSK_ID not defined\n");
|
||||
goto fail;
|
||||
|
||||
Reference in new issue
Block a user