summaryrefslogtreecommitdiff
path: root/docs/examples
Commit message (Collapse)AuthorAgeFilesLines
* Makefile.m32: rename -winssl option to -schannel and tidy upViktor Szakats2021-11-251-22/+22
| | | | | | | | | | | | - accept `-schannel` as an alternative to `CFG` option `-winssl` (latter still accepted, but deprecated) - rename internal variable `WINSSL` to `SCHANNEL` - make the `CFG` option evaluation shorter, without repeating the option name Reviewed-by: Marcel Raad Reviewed-by: Daniel Stenberg Closes #8053
* docs: reduce/avoid English contractionsDaniel Stenberg2021-11-0756-152/+153
| | | | | | | | | | | You're => You are Hasn't => Has not Doesn't => Does not Don't => Do not You'll => You will etc Closes #7930
* smooth-gtk-thread.c: enhance the mutex lock useDaniel Stenberg2021-11-011-39/+31
| | | | | | Reported-by: ryancaicse on github Fixes #7926 Closes #7931
* Makefile.m32: fix to not require OpenSSL with -libssh2 or -rtmp optionsViktor Szakats2021-10-251-3/+8
| | | | | | | | | | | | | | | Previously, -libssh2/-rtmp options assumed that OpenSSL is also enabled (and then failed with an error when not finding expected OpenSSL headers), but this isn't necessarly true, e.g. when building both libssh2 and curl against Schannel. This patch makes sure to only enable the OpenSSL backend with -libssh2/-rtmp, when there was no SSL option explicitly selected. - Re-implement the logic as a single block of script. - Also fix an indentation while there. Assisted-by: Jay Satiro Closes #7895
* examples/htmltidy: correct wrong printf() useDaniel Stenberg2021-10-151-4/+4
| | | | | | | | | ... and update the includes to match how current htmltidy wants them used. Reported-by: Stathis Kapnidis Fixes #7860 Closes #7861
* docs/examples: add missing binaries to gitignoreDaniel Gustafsson2021-10-061-0/+2
| | | | | | | | Commit f65d7889b added getreferrer, and commit ae8e11ed5 multi-legacy, both of which missed adding .gitignore clauses for the built binaries. Closes #7817 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* externalsocket: use WinSock 2.2Marcel Raad2021-09-281-1/+1
| | | | | | That's the only version we support. Closes https://github.com/curl/curl/pull/7778
* urlapi: add curl_url_strerror()i-ky2021-09-271-4/+4
| | | | | | | | | | Add curl_url_strerror() to convert CURLUcode into readable string and facilitate easier troubleshooting in programs using URL API. Extend CURLUcode with CURLU_LAST for iteration in unit tests. Update man pages with a mention of new function. Update example code and tests with new functionality where it fits. Closes #7605
* examples/imap-append: fix end-of-data checkDaniel Stenberg2021-09-251-1/+1
| | | | | | Reported-by: Alexander Chuykov Fixes #7774 Closes #7775
* copyrights: update copyright year rangesDaniel Stenberg2021-09-081-1/+1
|
* examples/*hiperfifo.c: fix calloc arguments to match function protogit-bruh2021-09-063-3/+3
| | | | Closes #7678
* mailing lists: move from cool.haxx.se to lists.haxx.seDaniel Stenberg2021-08-301-4/+4
|
* misc: update incorrect copyright year rangesDaniel Stenberg2021-08-161-1/+1
| | | | Closes #7577
* examples/ephiperfifo.c: simplify signal handlerDaniel Gustafsson2021-08-131-5/+3
| | | | | | | | | | | | | The signal handler registered for SIGINT is only handling SIGINT so there isn't much need for inspecting the signo. While there, rename the handler to be more specific. g_should_exit should really be of sig_atomic_t type, but relying on autoconf in the examples seems like a bad idea so keep that for now. Reviewed-by: Daniel Stenberg Closes #7310
* example/cookie_interface: fix scan-build printf warningDaniel Stenberg2021-07-261-3/+3
| | | | | | | Follow-up to 4b79c4fb565 Fixes #7497 Closes #7498
* examples/cookie_interface: avoid printfing time_t directlyCarlo Marcelo Arenas Belón2021-07-261-2/+2
| | | | | | | | | | | | | | | time_t representation is undefined and varies on bitsize and signedness, and as of C11 could be even non integer. instead of casting to unsigned long (which would truncate in systems with a 32bit long after 2106) use difftime to get the elapsed time as a double and print that (without decimals) instead. alternatively a cast to curl_off_t and its corresponding print formatting could have been used (at least in POSIX) but portability and curl agnostic code was prioritized. Closes #7490
* examples/multi-single: fix scan-build warningDaniel Stenberg2021-07-071-4/+5
| | | | | | | | warning: Value stored to 'mc' during its initialization is never read Follow-up to ae8e11ed5fd2ce Closes #7360
* docs/examples: use curl_multi_poll() in multi examplesDaniel Stenberg2021-07-0715-974/+290
| | | | | | | | | | | | The API is soon two years old and deserves being shown as the primary way to drive multi code as it makes it much easier to write code. multi-poll: removed multi-legacy: add to show how we did multi API use before curl_multi_wait/poll. Closes #7352
* examples: safer and more proper read callback logicDaniel Stenberg2021-07-016-149/+139
| | | | | | | | | | | | | | | | | | | The same callback code is used in: imap-append.c smtp-authzid.c smtp-mail.c smtp-multi.c smtp-ssl.c smtp-tls.c It should not assume that it can copy full lines into the buffer as it will encourage sloppy coding practices. Instead use byte-wise logic and check/acknowledge the buffer size appropriately. Reported-by: Harry Sintonen Fixes #7330 Closes #7331
* examples: length-limit two sscanf() uses of %sDaniel Stenberg2021-06-242-3/+3
| | | | | | Reported-by: Jishan Shaikh Fixes #7293 Closes #7294
* metalink: removeDaniel Stenberg2021-06-071-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warning: this will make existing curl command lines that use metalink to stop working. Reasons for removal: 1. We've found several security problems and issues involving the metalink support in curl. The issues are not detailed here. When working on those, it become apparent to the team that several of the problems are due to the system design, metalink library API and what the metalink RFC says. They are very hard to fix on the curl side only. 2. The metalink usage with curl was only very briefly documented and was not following the "normal" curl usage pattern in several ways, making it surprising and non-intuitive which could lead to further security issues. 3. The metalink library was last updated 6 years ago and wasn't so active the years before that either. An unmaintained library means there's a security problem waiting to happen. This is probably reason enough. 4. Metalink requires an XML parsing library, which is complex code (even the smaller alternatives) and to this day often gets security updates. 5. Metalink is not a widely used curl feature. In the 2020 curl user survey, only 1.4% of the responders said that they'd are using it. In 2021 that number was 1.2%. Searching the web also show very few traces of it being used, even with other tools. 6. The torrent format and associated technology clearly won for downloading large files from multiple sources in parallel. Cloes #7176
* copyright: update copyright year ranges to 2021Daniel Stenberg2021-05-261-1/+1
|
* tidy-up: make conditional checks more consistentDaniel Stenberg2021-04-226-22/+22
| | | | | | ... remove '== NULL' and '!= 0' Closes #6912
* misc: update copyright year ranges to match latest updatesDaniel Stenberg2021-04-131-1/+1
|
* examples/hiperfifo.c: check event_initialized before deleteJochem Broekhoff2021-04-091-2/+6
| | | | | | | | If event_del is called with the event struct (still) zeroed out, a segmentation fault may occur. event_initialized checks whether the event struct is nonzero. Closes #6876
* copyright: update copyright year ranges to 2021Daniel Stenberg2021-03-271-1/+1
| | | | | Reviewed-by: Emil Engler Closes #6802
* examples: Remove threaded-shared-conn.c due to bugJay Satiro2021-03-262-157/+0
| | | | | | | | | | Known bug 11.11 is the shared object's connection cache is not thread safe, so we should not have an example for it. Ref: https://github.com/curl/curl/issues/4915 Ref: https://curl.se/docs/knownbugs.html#A_shared_connection_cache_is_not Closes https://github.com/curl/curl/pull/6795
* http: add new files missed from referrer commitViktor Szakats2021-02-191-0/+57
| | | | | Ref: 44872aefc2d54f297caf2b0cc887df321bc9d791 Ref: #6591
* http: add support to read and store the referrer headerViktor Szakats2021-02-191-0/+1
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* docs/Makefile.inc: format to be update-friendlyViktor Szakats2021-02-111-23/+120
| | | | | | | | | | - one source file per line - convert tabs to spaces - do not align line-continuation backslashes - sort source files alphabetically Reviewed-by: Daniel Stenberg Closes #6593
* Makefile.m32: add support for libgsasl dependencyViktor Szakats2021-02-101-0/+11
| | | | | Reviewed-by: Marcel Raad Closes #6586
* examples/curlgtk.c: fix the copyright year rangeDaniel Stenberg2020-12-301-10/+9
| | | | ... and make private functions static.
* docs/examples: adjust prototypes for CURLOPT_READFUNCTIONOlaf Hering2020-12-3015-15/+15
| | | | | | | The type of the buffer in curl_read_callback is 'char *', not 'void *'. Signed-off-by: Olaf Hering <olaf@aepfle.de> Closes #6392
* examples: fix more empty expression statement has no effectDaniel Stenberg2020-12-303-13/+16
| | | | Follow-up to 26e46617b9
* cleanup: fix two empty expression statement has no effectDaniel Stenberg2020-12-301-1/+1
| | | | Follow-up to 26e46617b9
* examples/libtest: add .checksrc to distDaniel Stenberg2020-12-211-1/+1
| | | | | | | ... so that (auto)builds from tarballs also get the correct instructions. Fixes #6176 Closes #6353
* examples: remove superfluous asterisk usesDaniel Stenberg2020-12-163-6/+6
| | | | ... for function pointers. Breaks in ancient compilers.
* examples: update .gitignoreRikard Falkeborn2020-11-231-4/+8
| | | | | | | | | | | | Add files that are generated by 'make examples' and remove some that have been renamed. The commits that renamed the programs are e9625c5bc6c046a (imap.c and simplesmtp.c were renamed to imap-fetch.c and smtp-send.c) and ad39e7ec01e7 (pop3slist.c and pop3s.c were renamed to pop3-list.c and pop3-ssl.c). Closes #6240
* httpput-postfields.c: new example doing PUT with POSTFIELDSDaniel Stenberg2020-11-132-1/+102
| | | | | | Proposed-by: Jeroen Ooms Ref: #6186 Closes #6188
* examples/httpput: remove use of CURLOPT_PUTDaniel Stenberg2020-11-091-4/+1
| | | | | | | | It is deprecated and unnecessary since it already sets CURLOPT_UPLOAD. Reported-by: Jeroen Ooms Fixes #6186 Closes #6187
* examples: fix comment syntaxDaniel Gustafsson2020-11-051-1/+1
| | | | | | | Commit ac0a88fd2 accidentally added a stray character outside of the comment which broke compilation. Fix by removing. Reported-by: autobuild https://curl.se/dev/log.cgi?id=20201105084306-12742
* copyright: fix year rangesDaniel Stenberg2020-11-05101-102/+102
| | | | Follow-up from 4d2f8006777
* curl.se: new homeDaniel Stenberg2020-11-04119-124/+124
| | | | Closes #6172
* Makefile.m32: add support for HTTP/3 via ngtcp2+nghttp3Viktor Szakats2020-10-161-0/+23
| | | | | Approved-by: Daniel Stenberg Closes #6092
* examples/README: convert to markdownDaniel Stenberg2020-09-302-14/+10
| | | | Closes #6028
* lib: fix -Wassign-enum warningsDaniel Stenberg2020-09-081-3/+3
| | | | | | | | | | configure --enable-debug now enables -Wassign-enum with clang, identifying several enum "abuses" also fixed. Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/879007f8118771f4896334731aaca5850a154675#commitcomment-42087553 Closes #5929
* Makefile.m32: add ability to override zstd libs [ci skip]Viktor Szakats2020-08-221-1/+6
| | | | | | | | | | Similarly to brotli, where this was already possible. E.g. it allows to link zstd statically to libcurl.dll. Ref: https://github.com/curl/curl-for-win/issues/12 Ref: https://github.com/curl/curl-for-win/commit/d9b266afd2e5d3f5604483010ef62340b5918c89 Closes https://github.com/curl/curl/pull/5840
* examples/rtsp.c: correct the copyright yearDaniel Stenberg2020-08-171-1/+1
|
* docs: change "web site" to "website"H3RSKO2020-08-172-3/+3
| | | | | | | | | According to wikipedia: While "web site" was the original spelling, this variant has become rarely used, and "website" has become the standard spelling Closes #5822
* checksrc: invoke script with -D to find .checksrc properDaniel Stenberg2020-08-011-1/+1
| | | | | | | | | | Without the -D command line option, checksrc.pl won't know which directory to load the ".checksrc" file from when building out of the source tree. Reported-by: Marcel Raad Fixes #5715 Closes #5755