mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 18:32:53 +03:00
coap_session.[hc]: make argument of coap_session_max_pdu_size() const
As the session object passed to coap_session_max_pdu_size() is not modified it should be const.
This commit is contained in:
1 parent
144ec406ac
commit
48b1eff004
2 files changed
+2
-2
No files matched your search
@@ -160,7 +160,7 @@ void coap_session_set_mtu(coap_session_t *session, unsigned mtu);
|
||||
* @param session The CoAP session.
|
||||
* @return maximum PDU size, not including header (but including token).
|
||||
*/
|
||||
size_t coap_session_max_pdu_size(coap_session_t *session);
|
||||
size_t coap_session_max_pdu_size(const coap_session_t *session);
|
||||
|
||||
/**
|
||||
* Creates a new client session to the designated server.
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ void coap_session_free(coap_session_t *session) {
|
||||
coap_free_type(COAP_SESSION, session);
|
||||
}
|
||||
|
||||
size_t coap_session_max_pdu_size(coap_session_t *session) {
|
||||
size_t coap_session_max_pdu_size(const coap_session_t *session) {
|
||||
size_t max_with_header = (size_t)(session->mtu - session->tls_overhead);
|
||||
if (COAP_PROTO_NOT_RELIABLE(session->proto))
|
||||
return max_with_header > 4 ? max_with_header - 4 : 0;
|
||||
|
||||
Reference in new issue
Block a user