summaryrefslogtreecommitdiff
path: root/lib/mqtt.c
Commit message (Collapse)AuthorAgeFilesLines
* mqtt: clear the leftovers pointer when sending succeedsz2_ on hackerone2021-09-131-0/+4
| | | | | | CVE-2021-22945 Bug: https://curl.se/docs/CVE-2021-22945.html
* infof: remove newline from format strings, always append itDaniel Stenberg2021-07-071-8/+8
| | | | | | | | | | | | | | | | - the data needs to be "line-based" anyway since it's also passed to the debug callback/application - it makes infof() work like failf() and consistency is good - there's an assert that triggers on newlines in the format string - Also removes a few instances of "..." - Removes the code that would append "..." to the end of the data *iff* it was truncated in infof() Closes #7357
* mqtt: extend the error message for no topicDaniel Stenberg2021-06-301-13/+5
| | | | | | | | ... and mention that it needs URL encoding. Reported-by: Peter Körner Fixes #7316 Closes #7317
* mqtt: add support for username and passwordGealber Morales2021-06-121-30/+180
| | | | | | | Minor-edits-by: Daniel Stenberg Added test 2200 to 2205 Closes #7243
* mqtt: detect illegal and too large file sizeHarry Sintonen2021-06-021-0/+10
| | | | | Add test 3017 and 3018 to verify. Closes #7166
* conn: add 'attach' to protocol handler, make libssh2 use itDaniel Stenberg2021-05-171-0/+1
| | | | | | | | | | | The libssh2 backend has SSH session associated with the connection but the callback context is the easy handle, so when a connection gets attached to a transfer, the protocol handler now allows for a custom function to get used to set things up correctly. Reported-by: Michael O'Farrell Fixes #6898 Closes #7078
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-68/+73
| | | | | | | | | | | | | | | | | | | | | ... in most cases instead of 'struct connectdata *' but in some cases in addition to. - We mostly operate on transfers and not connections. - We need the transfer handle to log, store data and more. Everything in libcurl is driven by a transfer (the CURL * in the public API). - This work clarifies and separates the transfers from the connections better. - We should avoid "conn->data". Since individual connections can be used by many transfers when multiplexing, making sure that conn->data points to the current and correct transfer at all times is difficult and has been notoriously error-prone over the years. The goal is to ultimately remove the conn->data pointer for this reason. Closes #6425
* mqtt: handle POST/PUBLISH without a set POSTFIELDSIZEDaniel Stenberg2020-12-181-1/+9
| | | | | | | | | Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28735 Added test 1916 and 1917 to verify. Closes #6338
* mqtt: deal with 0 byte reads correctlyDaniel Stenberg2020-12-151-2/+2
| | | | | | | OSS-Fuzz found it Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28676 Closes #6327
* urldata: remove 'void *protop' and create the union 'p'Daniel Stenberg2020-11-231-5/+5
| | | | | | | ... to avoid the use of 'void *' for the protocol specific structs done per transfer. Closes #6238
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* sendf: move the verbose-check into Curl_debugDaniel Stenberg2020-11-021-11/+6
| | | | | | Saves us from having the same check done everywhere. Closes #6159
* Curl_handler: add 'family' to each protocolDaniel Stenberg2020-09-211-0/+1
| | | | | | | Makes get_protocol_family() faster and it moves the knowledge about the "families" to each protocol handler, where it belongs. Closes #5986
* mqtt.c: avoid curl_ prefix on local variableDaniel Stenberg2020-09-021-3/+3
| | | | Closes #5906
* mqtt: enable by defaultDaniel Stenberg2020-08-311-2/+2
| | | | | | No longer considered experimental. Closes #5858
* escape: make the URL decode able to reject only %00 bytesDaniel Stenberg2020-06-251-1/+2
| | | | | | ... or all "control codes" or nothing. Assisted-by: Nicolas Sterchele
* urldata: let the HTTP method be in the set.* structDaniel Stenberg2020-06-021-1/+1
| | | | | | | | | | | | When the method is updated inside libcurl we must still not change the method as set by the user as then repeated transfers with that same handle might not execute the same operation anymore! This fixes the libcurl part of #5462 Test 1633 added to verify. Closes #5499
* mqtt: make NOSTATE get within the debug name arrayDaniel Stenberg2020-04-201-1/+3
|
* mqtt: remove code with no purposeDaniel Stenberg2020-04-201-2/+0
| | | | | | | | | | Detected by Coverity. CID 1462319. "The same code is executed when the condition result is true or false, because the code in the if-then branch and after the if statement is identical." Closes #5275
* mqtt: fix Curl_read() error handling while reading remaining lengthDaniel Stenberg2020-04-201-0/+2
| | | | | | Detected by Coverity. CID 1462320. Closes #5274
* mqtt: improve the state machineDaniel Stenberg2020-04-201-58/+122
| | | | | | | | | | To handle PUBLISH before SUBACK and more. Updated the existing tests and added three new ones. Reported-by: Christoph Krey Bug: https://curl.haxx.se/mail/lib-2020-04/0021.html Closes #5246
* mqtt: add new experimental protocolBjorn Stenberg2020-04-141-0/+561
Closes #5173