mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-25 08:31:04 +03:00
Fix gcc warning messages.
This commit is contained in:
1 parent
0a0cd1fb4e
commit
f6047c8e77
4 files changed
+14
-2
No files matched your search
+1
-1
@@ -199,7 +199,7 @@ coap_context_t *coap_new_context(const coap_address_t *listen_addr);
|
||||
*/
|
||||
|
||||
void coap_context_set_psk( coap_context_t *ctx, const char *hint,
|
||||
const uint8_t *key, unsigned key_len );
|
||||
const uint8_t *key, size_t key_len );
|
||||
|
||||
/**
|
||||
* Returns a new message id and updates @p context->message_id accordingly. The
|
||||
|
||||
@@ -606,4 +606,10 @@ int coap_dtls_receive(coap_session_t *session,
|
||||
return r;
|
||||
}
|
||||
|
||||
#else /* !HAVE_OPENSSL */
|
||||
|
||||
/* make compilers happy that do not like empty modules */
|
||||
static inline void dummy(void) {
|
||||
}
|
||||
|
||||
#endif /* HAVE_OPENSSL */
|
||||
+3
-1
@@ -312,11 +312,13 @@ int coap_dtls_get_context_timeout(void *dtls_context) {
|
||||
}
|
||||
|
||||
int coap_dtls_get_timeout(coap_session_t *session) {
|
||||
(void)session;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void coap_dtls_handle_timeout(coap_session_t *session) {
|
||||
return 0;
|
||||
(void)session;
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -349,6 +349,8 @@ coap_get_session_client_psk(
|
||||
uint8_t *identity, size_t *identity_len, size_t max_identity_len,
|
||||
uint8_t *psk, size_t max_psk_len
|
||||
) {
|
||||
(void)hint;
|
||||
(void)hint_len;
|
||||
if (session->psk_identity && session->psk_identity_len > 0 && session->psk_key && session->psk_key_len > 0) {
|
||||
if (session->psk_identity_len <= max_identity_len && session->psk_key_len <= max_psk_len) {
|
||||
memcpy(identity, session->psk_identity, session->psk_identity_len);
|
||||
@@ -373,6 +375,8 @@ coap_get_context_server_psk(
|
||||
const uint8_t *identity, size_t identity_len,
|
||||
uint8_t *psk, size_t max_psk_len
|
||||
) {
|
||||
(void)identity;
|
||||
(void)identity_len;
|
||||
const coap_context_t *ctx = session->context;
|
||||
if (ctx && ctx->psk_key && ctx->psk_key_len > 0 && ctx->psk_key_len <= max_psk_len) {
|
||||
memcpy(psk, ctx->psk_key, ctx->psk_key_len);
|
||||
|
||||
Reference in new issue
Block a user