mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 09:42:54 +03:00
coap_session.c: fixed default port selection for client TCP session
In coap_session_create_client(), the default port for TCP did not correctly distinguish between TCP and TLS as pointed out in [1] by Joan Shallow. This change applies the suggested fix. [1] https://sourceforge.net/p/libcoap/mailman/message/36092184/
This commit is contained in:
1 parent
a5dd017ec1
commit
6a3abd257e
1 file changed
+1
-1
+1
-1
@@ -444,7 +444,7 @@ coap_session_create_client(
|
||||
}
|
||||
} else if (proto == COAP_PROTO_TCP || proto == COAP_PROTO_TLS) {
|
||||
if (!coap_socket_connect_tcp1(&session->sock, &session->local_if, server,
|
||||
proto == COAP_PROTO_DTLS ? COAPS_DEFAULT_PORT : COAP_DEFAULT_PORT,
|
||||
proto == COAP_PROTO_TLS ? COAPS_DEFAULT_PORT : COAP_DEFAULT_PORT,
|
||||
&session->local_addr, &session->remote_addr)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user