@@ -73,6 +73,8 @@ namespace Aws
73
73
74
74
struct PubCallbackData
75
75
{
76
+ PubCallbackData () : connection(nullptr ), allocator(nullptr ) {}
77
+
76
78
MqttConnection *connection;
77
79
OnPublishReceivedHandler onPublishReceived;
78
80
Allocator *allocator;
@@ -102,6 +104,8 @@ namespace Aws
102
104
103
105
struct OpCompleteCallbackData
104
106
{
107
+ OpCompleteCallbackData () : connection(nullptr ), topic(nullptr ), allocator(nullptr ) {}
108
+
105
109
MqttConnection *connection;
106
110
OnOperationCompleteHandler onOperationComplete;
107
111
const char *topic;
@@ -132,6 +136,8 @@ namespace Aws
132
136
133
137
struct SubAckCallbackData
134
138
{
139
+ SubAckCallbackData () : connection(nullptr ), topic(nullptr ), allocator(nullptr ) {}
140
+
135
141
MqttConnection *connection;
136
142
OnSubAckHandler onSubAck;
137
143
const char *topic;
@@ -165,6 +171,8 @@ namespace Aws
165
171
166
172
struct MultiSubAckCallbackData
167
173
{
174
+ MultiSubAckCallbackData () : connection(nullptr ), topic(nullptr ), allocator(nullptr ) {}
175
+
168
176
MqttConnection *connection;
169
177
OnMultiSubAckHandler onSubAck;
170
178
const char *topic;
@@ -236,11 +244,11 @@ namespace Aws
236
244
aws_mqtt_transform_websocket_handshake_complete_fn *complete_fn,
237
245
void *complete_ctx)
238
246
{
239
- MqttConnection * connection = reinterpret_cast <MqttConnection *>(user_data);
247
+ auto connection = reinterpret_cast <MqttConnection *>(user_data);
240
248
241
249
Allocator *allocator = connection->m_owningClient ->allocator ;
242
250
// we have to do this because of private constructors.
243
- Http::HttpRequest * toSeat =
251
+ auto toSeat =
244
252
reinterpret_cast <Http::HttpRequest *>(aws_mem_acquire (allocator, sizeof (Http::HttpRequest)));
245
253
toSeat = new (toSeat) Http::HttpRequest (allocator, rawRequest);
246
254
@@ -265,7 +273,7 @@ namespace Aws
265
273
const Crt::Io::TlsContext &tlsContext,
266
274
bool useWebsocket) noexcept
267
275
: m_owningClient(client), m_tlsContext(tlsContext), m_tlsOptions(tlsContext.NewConnectionOptions()),
268
- m_useTls (true ), m_useWebsocket(useWebsocket)
276
+ m_onAnyCbData ( nullptr ), m_useTls(true ), m_useWebsocket(useWebsocket)
269
277
{
270
278
s_connectionInit (this , hostName, port, socketOptions);
271
279
}
0 commit comments