summaryrefslogtreecommitdiff
path: root/lib/pop3.c
Commit message (Collapse)AuthorAgeFilesLines
* pingpong: remove the 'conn' struct memberDaniel Stenberg2021-01-261-2/+1
| | | | | | | ... as it's superfluous now when Curl_easy is passed in and we can derive the connection from that instead and avoid the duplicate copy. Closes #6525
* lib: remove conn->data usesPatrick Monnerat2021-01-241-2/+2
| | | | Closes #6499
* lib: more conn->data cleanupsDaniel Stenberg2021-01-191-1/+1
| | | | Closes #6479
* vtls: reduce conn->data usePatrick Monnerat2021-01-191-2/+3
| | | | Closes #6474
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-169/+176
| | | | | | | | | | | | | | | | | | | | | ... 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
* urldata: remove 'void *protop' and create the union 'p'Daniel Stenberg2020-11-231-7/+7
| | | | | | | ... 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
* pingpong: use a dynbuf for the *_pp_sendf() functionDaniel Stenberg2020-09-231-0/+1
| | | | | | | | | | | | | | ... reuses the same dynamic buffer instead of doing repeated malloc/free cycles. Test case 100 (FTP dir list PASV) does 7 fewer memory allocation calls after this change in my test setup (132 => 125), curl 7.72.0 needed 140 calls for this. Test case 103 makes 9 less allocations now (130). Down from 149 in 7.72.0. Closes #6004
* Curl_handler: add 'family' to each protocolDaniel Stenberg2020-09-211-0/+2
| | | | | | | Makes get_protocol_family() faster and it moves the knowledge about the "families" to each protocol handler, where it belongs. Closes #5986
* escape: make the URL decode able to reject only %00 bytesDaniel Stenberg2020-06-251-2/+2
| | | | | | ... or all "control codes" or nothing. Assisted-by: Nicolas Sterchele
* urldata: connect related booleans live in struct ConnectBitsDaniel Stenberg2020-05-271-2/+2
| | | | | | And remove a few unused booleans! Closes #5461
* source cleanup: remove all custom typedef structsDaniel Stenberg2020-05-151-2/+2
| | | | | | | | | | | - Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions. Closes #5338
* cleanup: remove the 'numsocks' argument used in many placesDaniel Stenberg2019-07-301-5/+3
| | | | | | | | | It was used (intended) to pass in the size of the 'socks' array that is also passed to these functions, but was rarely actually checked/used and the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries that should be used instead. Closes #4169
* build: fix Codacy warningsMarcel Raad2019-06-051-10/+5
| | | | | | Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
* emailL Added reference to RFC8314 for implicit TLSSteve Holme2019-04-111-0/+1
|
* urldata: simplify bytecountersDaniel Stenberg2019-03-011-1/+1
| | | | | | | | | | | | | - no need to have them protocol specific - no need to set pointers to them with the Curl_setup_transfer() call - make Curl_setup_transfer() operate on a transfer pointer, not connection - switch some counters from long to the more proper curl_off_t type Closes #3627
* memcmp: avoid doing single char memcmpDaniel Gustafsson2019-01-201-3/+3
| | | | | | | | | | There is no real gain in performing memcmp() comparisons on single characters, so change these to array subscript inspections which saves a call and makes the code clearer. Closes #3486 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
* pingpong: ignore regular timeout in disconnect phaseDaniel Stenberg2018-12-171-4/+5
| | | | | | | | | | | The timeout set with CURLOPT_TIMEOUT is no longer used when disconnecting from one of the pingpong protocols (FTP, IMAP, SMTP, POP3). Reported-by: jasal82 on github Fixes #3264 Closes #3374
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-1/+1
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* pop3: only do APOP with a valid timestampDaniel Stenberg2018-11-161-2/+10
| | | | | | Brought-by: bobmitchell1956 on github Fixes #3278 Closes #3279
* url: use the URL API internally as wellDaniel Stenberg2018-09-221-4/+1
| | | | | | ... to make it a truly unified URL parser. Closes #3017
* cppcheck: fix warningsMarian Klymov2018-06-111-2/+2
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* smtp/pop3/imap_get_message: decrease the data length too...Daniel Stenberg2018-01-151-3/+5
| | | | | | | | Follow-up commit to 615edc1f73 which was incomplete. Assisted-by: Max Dymond Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5206
* sasl_getmesssage: make sure we have a long enough string to passDaniel Stenberg2017-12-051-12/+17
| | | | | | | | | | For pop3/imap/smtp, added test 891 to somewhat verify the pop3 case. For this, I enhanced the pingpong test server to be able to send back responses with LF-only instead of always using CRLF. Closes #2150
* handler: refactor connection checkingMax Dymond2017-06-301-0/+2
| | | | | | Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
* http-proxy: only attempt FTP over HTTP proxyDaniel Stenberg2017-06-151-77/+0
| | | | | | | | | | ... all other non-HTTP protocol schemes are now defaulting to "tunnel trough" mode if a HTTP proxy is specified. In reality there are no HTTP proxies out there that allow those other schemes. Assisted-by: Ray Satiro, Michael Kaufmann Closes #1505
* URL: only accept ";options" in SMTP/POP3/IMAP URL schemesDaniel Stenberg2017-02-101-3/+4
| | | | Fixes #1252
* STARTTLS: Don't print response character in denied messagesJay Satiro2017-01-121-1/+1
| | | | | | | Both IMAP and POP3 response characters are used internally, but when appended to the STARTTLS denial message likely could confuse the user. Closes https://github.com/curl/curl/pull/1203
* checksrc: white space edits to comply to stricter checksrcDaniel Stenberg2016-11-241-2/+2
|
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-2/+2
|
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-1/+0
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-4/+3
| | | | | | | ... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
* errors: new alias CURLE_WEIRD_SERVER_REPLY (8)Jay Satiro2016-09-071-1/+1
| | | | | | | | Since we're using CURLE_FTP_WEIRD_SERVER_REPLY in imap, pop3 and smtp as more of a generic "failed to parse" introduce an alias without FTP in the name. Closes https://github.com/curl/curl/pull/975
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-17/+17
|
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
* multi: turn Curl_done into file local multi_doneDaniel Stenberg2016-03-301-4/+0
| | | | ... as it now is used by multi.c only.
* ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabledSteve Holme2016-03-191-2/+2
| | | | warning C4706: assignment within conditional expression
* imap/pop3/smtp: Fixed connections upgraded with TLS are not reusedSteve Holme2016-03-081-1/+9
| | | | | | | Regression since commit 710f14edba. Bug: https://github.com/curl/curl/issues/422 Reported-by: Justin Ehlert
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* pop3: Differentiate between success and continuation responsesSteve Holme2015-11-201-4/+10
|
* pop3: Added clarity on some server response codesSteve Holme2015-11-201-2/+4
|
* mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg2015-03-031-4/+1
| | | | | ... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
* sasl: implement EXTERNAL authentication mechanism.Patrick Monnerat2015-01-271-3/+3
| | | | | Its use is only enabled by explicit requirement in URL (;AUTH=EXTERNAL) and by not setting the password.
* SASL: common state engine for imap/pop3/smtpPatrick Monnerat2015-01-201-775/+74
|
* SASL: common URL option and auth capabilities decoders for all protocolsPatrick Monnerat2015-01-201-70/+37
|
* IMAP/POP3/SMTP: use a per-connection sub-structure for SASL parameters.Patrick Monnerat2015-01-201-53/+53
|
* IPV6: address scope != scope idPatrick Monnerat2014-12-161-1/+0
| | | | | | | | | | | | | | | | | | There was a confusion between these: this commit tries to disambiguate them. - Scope can be computed from the address itself. - Scope id is scope dependent: it is currently defined as 1-based local interface index for link-local scoped addresses, and as a site index(?) for (obsolete) site-local addresses. Linux only supports it for link-local addresses. The URL parser properly parses a scope id as an interface index, but stores it in a field named "scope": confusion. The field has been renamed into "scope_id". Curl_if2ip() used the scope id as it was a scope. This caused failures to bind to an interface. Scope is now computed from the addresses and Curl_if2ip() matches them. If redundantly specified in the URL, scope id is check for mismatch with the interface index. This commit should fix SF bug #1451.
* kerberos: Use symbol qualified with _KERBEROS5Michael Osipov2014-11-161-3/+3
| | | | For consistency renamed USE_KRB5 to USE_KERBEROS5.
* sasl: Fixed Kerberos V5 inclusion when CURL_DISABLE_CRYPTO_AUTH is usedSteve Holme2014-11-021-3/+3
| | | | | | | | | | | Typically the USE_WINDOWS_SSPI definition would not be used when the CURL_DISABLE_CRYPTO_AUTH define is, however, it is still a valid build configuration and, as such, the SASL Kerberos V5 (GSSAPI) authentication data structures and functions would incorrectly be used when they shouldn't be. Introduced a new USE_KRB5 definition that takes into account the use of CURL_DISABLE_CRYPTO_AUTH like USE_SPNEGO and USE_NTLM do.
* pop3_perform_authentication: fix memory leakDaniel Stenberg2014-10-021-2/+2
| | | | | | Coverity CID 1215287. There's a potential risk for a memory leak in here, and moving the free call to be unconditional seems like a cheap price to remove the risk.