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:
Olaf Bergmann committed 2017-11-03 10:41:05 +01:00
1 parent a5dd017ec1
commit 6a3abd257e
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}