Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 46150f7

Browse files
committed
Move httpHeaders to end of connect options for binary compatibility eclipse-paho#887
1 parent bccb3ca commit 46150f7

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/MQTTAsync.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ typedef struct
10541054
{
10551055
/** The eyecatcher for this structure. must be MQTC. */
10561056
char struct_id[4];
1057-
/** The version number of this structure. Must be 0, 1, 2, 3 4 5 or 6.
1057+
/** The version number of this structure. Must be 0, 1, 2, 3 4 5 6 or 7.
10581058
* 0 signifies no SSL options and no serverURIs
10591059
* 1 signifies no serverURIs
10601060
* 2 signifies no MQTTVersion
@@ -1193,10 +1193,6 @@ typedef struct
11931193
int len; /**< binary password length */
11941194
const void* data; /**< binary password data */
11951195
} binarypwd;
1196-
/**
1197-
* httpHeaders
1198-
*/
1199-
const MQTTAsync_nameValue* httpHeaders;
12001196
/*
12011197
* MQTT V5 clean start flag. Only clears state at the beginning of the session.
12021198
*/
@@ -1221,14 +1217,18 @@ typedef struct
12211217
* completion will be received.
12221218
*/
12231219
MQTTAsync_onFailure5* onFailure5;
1220+
/**
1221+
* httpHeaders
1222+
*/
1223+
const MQTTAsync_nameValue* httpHeaders;
12241224
} MQTTAsync_connectOptions;
12251225

12261226

12271227
#define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1228-
NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, NULL, 0, NULL, NULL, NULL, NULL}
1228+
NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL}
12291229

12301230
#define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1231-
NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, NULL, 1, NULL, NULL, NULL, NULL}
1231+
NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL}
12321232

12331233

12341234
/**

src/MQTTClient.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ typedef struct
781781
{
782782
/** The eyecatcher for this structure. must be MQTC. */
783783
char struct_id[4];
784-
/** The version number of this structure. Must be 0, 1, 2, 3, 4, 5 or 6.
784+
/** The version number of this structure. Must be 0, 1, 2, 3, 4, 5, 6 or 7.
785785
* 0 signifies no SSL options and no serverURIs
786786
* 1 signifies no serverURIs
787787
* 2 signifies no MQTTVersion
@@ -908,10 +908,6 @@ typedef struct
908908
int len; /**< binary password length */
909909
const void* data; /**< binary password data */
910910
} binarypwd;
911-
/**
912-
* httpHeaders
913-
*/
914-
const MQTTClient_nameValue* httpHeaders;
915911
/**
916912
* The maximum number of messages in flight
917913
*/
@@ -920,11 +916,17 @@ typedef struct
920916
* MQTT V5 clean start flag. Only clears state at the beginning of the session.
921917
*/
922918
int cleanstart;
919+
/**
920+
* httpHeaders
921+
*/
922+
const MQTTClient_nameValue* httpHeaders;
923923
} MQTTClient_connectOptions;
924924

925-
#define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 1, NULL, NULL, NULL, 30, 0, NULL, 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, NULL, -1, 0}
925+
#define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 1, NULL, NULL, NULL, 30, 0, NULL,\
926+
0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0, NULL}
926927

927-
#define MQTTClient_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 1, NULL, NULL, NULL, 30, 0, NULL, 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, NULL, -1, 1}
928+
#define MQTTClient_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 1, NULL, NULL, NULL, 30, 0, NULL,\
929+
0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1, NULL}
928930

929931
/**
930932
* This function attempts to connect a previously-created client (see

0 commit comments

Comments
 (0)