summaryrefslogtreecommitdiff
path: root/lib/mqtt.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-11-23 08:32:41 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-11-23 16:16:16 +0100
commita95a6ce6b809693a1195e3b4347a6cfa0fbc2ee7 (patch)
tree5f0b777ade4540e7c622b6ad2d2126d920dafa6b /lib/mqtt.c
parent5c8849cede5577b8b23c3b1d75c03923ce034061 (diff)
downloadcurl-a95a6ce6b809693a1195e3b4347a6cfa0fbc2ee7.tar.gz
urldata: remove 'void *protop' and create the union 'p'
... to avoid the use of 'void *' for the protocol specific structs done per transfer. Closes #6238
Diffstat (limited to 'lib/mqtt.c')
-rw-r--r--lib/mqtt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/mqtt.c b/lib/mqtt.c
index 95fef6c25..e324ec3dd 100644
--- a/lib/mqtt.c
+++ b/lib/mqtt.c
@@ -96,12 +96,12 @@ static CURLcode mqtt_setup_conn(struct connectdata *conn)
during this request */
struct MQTT *mq;
struct Curl_easy *data = conn->data;
- DEBUGASSERT(data->req.protop == NULL);
+ DEBUGASSERT(data->req.p.mqtt == NULL);
mq = calloc(1, sizeof(struct MQTT));
if(!mq)
return CURLE_OUT_OF_MEMORY;
- data->req.protop = mq;
+ data->req.p.mqtt = mq;
return CURLE_OK;
}
@@ -111,7 +111,7 @@ static CURLcode mqtt_send(struct connectdata *conn,
CURLcode result = CURLE_OK;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
struct Curl_easy *data = conn->data;
- struct MQTT *mq = data->req.protop;
+ struct MQTT *mq = data->req.p.mqtt;
ssize_t n;
result = Curl_write(conn, sockfd, buf, len, &n);
if(!result)
@@ -425,7 +425,7 @@ static CURLcode mqtt_read_publish(struct connectdata *conn,
unsigned char *pkt = (unsigned char *)data->state.buffer;
size_t remlen;
struct mqtt_conn *mqtt = &conn->proto.mqtt;
- struct MQTT *mq = data->req.protop;
+ struct MQTT *mq = data->req.p.mqtt;
unsigned char packet;
switch(mqtt->state) {
@@ -531,7 +531,7 @@ static CURLcode mqtt_doing(struct connectdata *conn, bool *done)
CURLcode result = CURLE_OK;
struct mqtt_conn *mqtt = &conn->proto.mqtt;
struct Curl_easy *data = conn->data;
- struct MQTT *mq = data->req.protop;
+ struct MQTT *mq = data->req.p.mqtt;
ssize_t nread;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
unsigned char *pkt = (unsigned char *)data->state.buffer;