Skip to content

Commit e306027

Browse files
authored
Merge pull request #346 from eclipse-threadx/hotfix-a
Merge changes for v6.4.4.202503a
2 parents 8d84ebe + c1ca638 commit e306027

17 files changed

+53
-10
lines changed

addons/mqtt/nxd_mqtt_client.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,7 @@ UINT status;
25092509
client_ptr -> nxd_mqtt_client_websocket_host, client_ptr -> nxd_mqtt_client_websocket_host_length,
25102510
client_ptr -> nxd_mqtt_client_websocket_uri_path, client_ptr -> nxd_mqtt_client_websocket_uri_path_length,
25112511
(UCHAR *)NXD_MQTT_OVER_WEBSOCKET_PROTOCOL, sizeof(NXD_MQTT_OVER_WEBSOCKET_PROTOCOL) - 1,
2512+
client_ptr -> nxd_mqtt_client_websocket_bearer, client_ptr -> nxd_mqtt_client_websocket_bearer_length,
25122513
NX_NO_WAIT);
25132514

25142515
if (status != NX_IN_PROGRESS)
@@ -2616,6 +2617,7 @@ UINT status;
26162617
client_ptr -> nxd_mqtt_client_websocket_host, client_ptr -> nxd_mqtt_client_websocket_host_length,
26172618
client_ptr -> nxd_mqtt_client_websocket_uri_path, client_ptr -> nxd_mqtt_client_websocket_uri_path_length,
26182619
(UCHAR *)NXD_MQTT_OVER_WEBSOCKET_PROTOCOL, sizeof(NXD_MQTT_OVER_WEBSOCKET_PROTOCOL) - 1,
2620+
client_ptr -> nxd_mqtt_client_websocket_bearer, client_ptr -> nxd_mqtt_client_websocket_bearer_length,
26192621
NX_NO_WAIT);
26202622

26212623
if (status == NX_IN_PROGRESS)
@@ -4156,6 +4158,7 @@ UINT old_priority;
41564158
client_ptr -> nxd_mqtt_client_websocket_host, client_ptr -> nxd_mqtt_client_websocket_host_length,
41574159
client_ptr -> nxd_mqtt_client_websocket_uri_path, client_ptr -> nxd_mqtt_client_websocket_uri_path_length,
41584160
(UCHAR *)NXD_MQTT_OVER_WEBSOCKET_PROTOCOL, sizeof(NXD_MQTT_OVER_WEBSOCKET_PROTOCOL) - 1,
4161+
client_ptr -> nxd_mqtt_client_websocket_bearer, client_ptr -> nxd_mqtt_client_websocket_bearer_length,
41594162
wait_option);
41604163
}
41614164
else
@@ -4165,6 +4168,7 @@ UINT old_priority;
41654168
client_ptr -> nxd_mqtt_client_websocket_host, client_ptr -> nxd_mqtt_client_websocket_host_length,
41664169
client_ptr -> nxd_mqtt_client_websocket_uri_path, client_ptr -> nxd_mqtt_client_websocket_uri_path_length,
41674170
(UCHAR *)NXD_MQTT_OVER_WEBSOCKET_PROTOCOL, sizeof(NXD_MQTT_OVER_WEBSOCKET_PROTOCOL) - 1,
4171+
client_ptr -> nxd_mqtt_client_websocket_bearer, client_ptr -> nxd_mqtt_client_websocket_bearer_length,
41684172
wait_option);
41694173
}
41704174

@@ -6502,7 +6506,7 @@ NXD_MQTT_CLIENT *client_ptr = (NXD_MQTT_CLIENT *)context;
65026506
/* 10-31-2022 Yuxin Zhou Initial Version 6.2.0 */
65036507
/* */
65046508
/**************************************************************************/
6505-
UINT _nxd_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length)
6509+
UINT _nxd_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length, UCHAR *bearer, UINT bearer_length)
65066510
{
65076511
UINT status;
65086512

@@ -6519,6 +6523,8 @@ UINT status;
65196523
client_ptr -> nxd_mqtt_client_websocket_host_length = host_length;
65206524
client_ptr -> nxd_mqtt_client_websocket_uri_path = uri_path;
65216525
client_ptr -> nxd_mqtt_client_websocket_uri_path_length = uri_path_length;
6526+
client_ptr -> nxd_mqtt_client_websocket_bearer = bearer;
6527+
client_ptr -> nxd_mqtt_client_websocket_bearer_length = bearer_length;
65226528

65236529
/* Create WebSocket. */
65246530
status = nx_websocket_client_create(&client_ptr -> nxd_mqtt_client_websocket, (UCHAR *)"",
@@ -6580,7 +6586,7 @@ UINT status;
65806586
/* 10-31-2022 Yuxin Zhou Initial Version 6.2.0 */
65816587
/* */
65826588
/**************************************************************************/
6583-
UINT _nxde_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length)
6589+
UINT _nxde_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length, UCHAR *bearer, UINT bearer_length)
65846590
{
65856591

65866592
/* Validate the parameters. */
@@ -6590,6 +6596,6 @@ UINT _nxde_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, U
65906596
return(NX_PTR_ERROR);
65916597
}
65926598

6593-
return(_nxd_mqtt_client_websocket_set(client_ptr, host, host_length, uri_path, uri_path_length));
6599+
return(_nxd_mqtt_client_websocket_set(client_ptr, host, host_length, uri_path, uri_path_length, bearer, bearer_length));
65946600
}
65956601
#endif /* NXD_MQTT_OVER_WEBSOCKET */

addons/mqtt/nxd_mqtt_client.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ typedef struct NXD_MQTT_CLIENT_STRUCT
392392
UINT nxd_mqtt_client_websocket_host_length;
393393
UCHAR *nxd_mqtt_client_websocket_uri_path;
394394
UINT nxd_mqtt_client_websocket_uri_path_length;
395+
UCHAR *nxd_mqtt_client_websocket_bearer;
396+
UINT nxd_mqtt_client_websocket_bearer_length;
395397
#endif /* NXD_MQTT_OVER_WEBSOCKET */
396398
} NXD_MQTT_CLIENT;
397399

@@ -553,8 +555,8 @@ UINT _nxde_mqtt_client_secure_connect(NXD_MQTT_CLIENT *client_ptr, NXD_ADDRESS *
553555
#endif /* NX_SECURE_ENABLE */
554556

555557
#ifdef NXD_MQTT_OVER_WEBSOCKET
556-
UINT _nxd_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length);
557-
UINT _nxde_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length);
558+
UINT _nxd_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length, UCHAR *bearer, UINT bearer_length);
559+
UINT _nxde_mqtt_client_websocket_set(NXD_MQTT_CLIENT *client_ptr, UCHAR *host, UINT host_length, UCHAR *uri_path, UINT uri_path_length, UCHAR *bearer, UINT bearer_length);
558560
VOID _nxd_mqtt_client_websocket_connection_status_callback(NX_WEBSOCKET_CLIENT *websocket_client_ptr, VOID *context, UINT status);
559561
#endif /* NXD_MQTT_OVER_WEBSOCKET */
560562

addons/websocket/nx_websocket_client.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,14 @@ UINT nx_websocket_client_packet_allocate(NX_WEBSOCKET_CLIENT *client_ptr, NX_PA
265265
UINT nx_websocket_client_connect(NX_WEBSOCKET_CLIENT *client_ptr, NX_TCP_SOCKET *socket_ptr,
266266
UCHAR *host, UINT host_length,
267267
UCHAR *uri_path, UINT uri_path_length,
268-
UCHAR *protocol, UINT protocol_length,UINT wait_option);
268+
UCHAR *protocol, UINT protocol_length,
269+
UCHAR *bearer, UINT bearer_length, UINT wait_option);
269270
#ifdef NX_SECURE_ENABLE
270271
UINT nx_websocket_client_secure_connect(NX_WEBSOCKET_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session,
271272
UCHAR *host, UINT host_length,
272273
UCHAR *uri_path, UINT uri_path_length,
273-
UCHAR *protocol, UINT protocol_length,UINT wait_option);
274+
UCHAR *protocol, UINT protocol_length,
275+
UCHAR *bearer, UINT bearer_length, UINT wait_option);
274276
#endif /* NX_SECURE_ENABLE */
275277
UINT nx_websocket_client_disconnect(NX_WEBSOCKET_CLIENT *client_ptr, UINT wait_option);
276278
UINT nx_websocket_client_send(NX_WEBSOCKET_CLIENT *client_ptr, NX_PACKET *packet_ptr, UINT code, UINT is_final, UINT wait_option);
@@ -302,11 +304,13 @@ UINT _nx_websocket_client_connect(NX_WEBSOCKET_CLIENT *client_ptr, NX_TCP_SOCKE
302304
UINT _nxe_websocket_client_secure_connect(NX_WEBSOCKET_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session,
303305
UCHAR *host, UINT host_length,
304306
UCHAR *uri_path, UINT uri_path_length,
305-
UCHAR *protocol, UINT protocol_length,UINT wait_option);
307+
UCHAR *protocol, UINT protocol_length,
308+
UCHAR *bearer, UINT bearer_length, UINT wait_option);
306309
UINT _nx_websocket_client_secure_connect(NX_WEBSOCKET_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session,
307310
UCHAR *host, UINT host_length,
308311
UCHAR *uri_path, UINT uri_path_length,
309-
UCHAR *protocol, UINT protocol_length,UINT wait_option);
312+
UCHAR *protocol, UINT protocol_length,
313+
UCHAR *bearer, UINT bearer_length, UINT wait_option);
310314
#endif /* NX_SECURE_ENABLE */
311315
UINT _nxe_websocket_client_disconnect(NX_WEBSOCKET_CLIENT *client_ptr, UINT wait_option);
312316
UINT _nx_websocket_client_disconnect(NX_WEBSOCKET_CLIENT *client_ptr, UINT wait_option);

common/inc/nx_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ VOID _nx_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, ULONG
531531
#define NETXDUO_MINOR_VERSION 4
532532
#define NETXDUO_PATCH_VERSION 4
533533
#define NETXDUO_BUILD_VERSION 202503
534-
#define NETXDUO_HOTFIX_VERSION ''
534+
#define NETXDUO_HOTFIX_VERSION 'a'
535535

536536
/* Define the following symbols for backward compatibility */
537537
#define EL_PRODUCT_NETXDUO

common/src/nx_ip_packet_receive.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ UCHAR version_byte;
101101
packet_ptr -> nx_packet_address.nx_packet_interface_ptr = &(ip_ptr -> nx_ip_interface[0]);
102102
}
103103

104+
#ifndef NX_DISABLE_IPV4
104105
/* GHSA-pf5q-r6q5-6j2f:
105106
This is an IPv4 packet. Therefore the header length must be at least 20 bytes.
106107
Validate the payload size before accessing the IP header. */
@@ -113,6 +114,7 @@ UCHAR version_byte;
113114

114115
return;
115116
}
117+
#endif
116118

117119
/* It's assumed that the IP link driver has positioned the top pointer in the
118120
packet to the start of the IP address... so that's where we will start. */

test/regression/websocket_test/netx_websocket_16_bit_payload_length_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static void thread_server_entry(ULONG thread_input);
4747
#define TEST_HOST_NAME "1.2.3.4"
4848
#define TEST_URI_PATH "/test"
4949
#define TEST_PROTOCOL "test"
50+
#define TEST_BEARER ""
5051

5152
static UCHAR server_switch_101[] =
5253
{
@@ -322,6 +323,7 @@ UINT code;
322323
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
323324
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
324325
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
326+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
325327
NX_WAIT_FOREVER);
326328

327329
if (status)

test/regression/websocket_test/netx_websocket_connect_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static void thread_server_entry(ULONG thread_input);
7171
#define TEST_HOST_NAME "1.2.3.4"
7272
#define TEST_URI_PATH "/test"
7373
#define TEST_PROTOCOL "test"
74+
#define TEST_BEARER ""
7475

7576
static UCHAR bad_server_switch_101[] =
7677
{
@@ -314,6 +315,7 @@ UINT code;
314315
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
315316
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
316317
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
318+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
317319
NX_WAIT_FOREVER);
318320

319321
/* The first time is to test whether the bad response from server will be checked and found */
@@ -325,6 +327,7 @@ UINT code;
325327
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
326328
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
327329
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
330+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
328331
NX_WAIT_FOREVER);
329332
if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0)
330333
SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__);
@@ -348,6 +351,7 @@ UINT code;
348351
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
349352
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
350353
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
354+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
351355
NX_WAIT_FOREVER);
352356
if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0)
353357
SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__);

test/regression/websocket_test/netx_websocket_delete_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static void thread_server_entry(ULONG thread_input);
4848
#define TEST_HOST_NAME "1.2.3.4"
4949
#define TEST_URI_PATH "/test"
5050
#define TEST_PROTOCOL "test"
51+
#define TEST_BEARER ""
5152

5253
static UCHAR server_switch_101[] =
5354
{
@@ -226,6 +227,7 @@ UINT code;
226227
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
227228
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
228229
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
230+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
229231
NX_WAIT_FOREVER);
230232

231233
if (status)

test/regression/websocket_test/netx_websocket_disconnect_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static void thread_server_entry(ULONG thread_input);
4848
#define TEST_HOST_NAME "1.2.3.4"
4949
#define TEST_URI_PATH "/test"
5050
#define TEST_PROTOCOL "test"
51+
#define TEST_BEARER ""
5152

5253
static UCHAR server_switch_101[] =
5354
{
@@ -229,6 +230,7 @@ UINT code;
229230
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
230231
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
231232
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
233+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
232234
NX_WAIT_FOREVER);
233235

234236
if (status)

test/regression/websocket_test/netx_websocket_fin_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static void thread_server_entry(ULONG thread_input);
4747
#define TEST_HOST_NAME "1.2.3.4"
4848
#define TEST_URI_PATH "/test"
4949
#define TEST_PROTOCOL "test"
50+
#define TEST_BEARER ""
5051

5152
static UCHAR server_switch_101[] =
5253
{
@@ -233,6 +234,7 @@ UINT code;
233234
TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1,
234235
(UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1,
235236
(UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1,
237+
(UCHAR *)TEST_BEARER, sizeof(TEST_BEARER) -1,
236238
NX_WAIT_FOREVER);
237239

238240
if(status)

0 commit comments

Comments
 (0)