diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-11 22:28:44 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-11 22:43:33 +0300 |
commit | 175ec788d14db88a2fafb920c8b5117209c12d5b (patch) | |
tree | 5ff4a7d314ce3887c5df8f051d83866edd585ac1 /contrib/libs/curl/lib/mqtt.c | |
parent | b6c20a8a26d0be34045f2604b4da1ee189920ed2 (diff) | |
download | ydb-175ec788d14db88a2fafb920c8b5117209c12d5b.tar.gz |
Update contrib/libs/curl to 8.2.1
Diffstat (limited to 'contrib/libs/curl/lib/mqtt.c')
-rw-r--r-- | contrib/libs/curl/lib/mqtt.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/libs/curl/lib/mqtt.c b/contrib/libs/curl/lib/mqtt.c index 4f3d14386f..799a21a568 100644 --- a/contrib/libs/curl/lib/mqtt.c +++ b/contrib/libs/curl/lib/mqtt.c @@ -5,8 +5,8 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2020 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. - * Copyright (C) 2019, Björn Stenberg, <bjorn@haxx.se> + * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) Björn Stenberg, <bjorn@haxx.se> * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -122,8 +122,9 @@ static CURLcode mqtt_send(struct Curl_easy *data, struct MQTT *mq = data->req.p.mqtt; ssize_t n; result = Curl_write(data, sockfd, buf, len, &n); - if(!result) - Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); + if(result) + return result; + Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); if(len != (size_t)n) { size_t nsend = len - n; char *sendleftovers = Curl_memdup(&buf[n], nsend); @@ -242,7 +243,7 @@ static int init_connpack(char *packet, char *remain, int remain_pos) /* keep-alive 0 = disabled */ packet[remain_pos + 9] = 0x00; packet[remain_pos + 10] = 0x3c; - /*end of variable header*/ + /* end of variable header */ return remain_pos + 10; } @@ -251,7 +252,7 @@ static CURLcode mqtt_connect(struct Curl_easy *data) CURLcode result = CURLE_OK; int pos = 0; int rc = 0; - /*remain length*/ + /* remain length */ int remain_pos = 0; char remain[4] = {0}; size_t packetlen = 0; @@ -604,7 +605,7 @@ static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done) unsigned char packet; switch(mqtt->state) { - MQTT_SUBACK_COMING: +MQTT_SUBACK_COMING: case MQTT_SUBACK_COMING: result = mqtt_verify_suback(data); if(result) @@ -635,7 +636,7 @@ static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done) /* -- switched state -- */ remlen = mq->remaining_length; - infof(data, "Remaining length: %zd bytes", remlen); + infof(data, "Remaining length: %zu bytes", remlen); if(data->set.max_filesize && (curl_off_t)remlen > data->set.max_filesize) { failf(data, "Maximum file size exceeded"); @@ -687,7 +688,7 @@ static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done) result = CURLE_WEIRD_SERVER_REPLY; goto end; } - end: +end: return result; } |