1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 19:45:04 -05:00
Commit Graph

575 Commits

Author SHA1 Message Date
Daniel Stenberg
5c41f88c05
examples/parseurl.c: show off the URL API a bit
Closes #3030
2018-09-22 12:04:35 +02:00
Daniel Stenberg
ef38059f7e
examples/http2-pushinmemory: receive HTTP/2 pushed files in memory
Closes #3004
2018-09-18 10:37:26 +02:00
Kruzya
23524bf85b examples: Fix memory leaks from realloc errors
Make sure to not overwrite the reallocated pointer in realloc() calls
to avoid a memleak on memory errors.
2018-09-17 14:07:47 +02:00
Marcel Raad
6a7feb103a
anyauthput: fix compiler warning on 64-bit Windows
On Windows, the read function from <io.h> is used, which has its byte
count parameter as unsigned int instead of size_t.

Closes https://github.com/curl/curl/pull/2972
2018-09-12 12:25:53 +02:00
Daniel Stenberg
00c3254595 example/asiohiper: insert warning comment about its status
This example is simply not working correctly but there's nobody around
with the skills and energy to fix it.

Closes #2407
2018-09-10 17:42:39 +02:00
Kamil Dudka
1d173f3413 docs/examples: do not wait when no transfers are running
Closes #2948
2018-09-10 12:23:23 +02:00
Marcel Raad
60776a0515
curl-compilers: enable -Wbad-function-cast on GCC
This warning used to be enabled only for clang as it's a bit stricter
on GCC. Silence the remaining occurrences and enable it on GCC too.

Closes https://github.com/curl/curl/pull/2747
2018-08-21 18:53:45 +02:00
Jay Satiro
0898331474 examples/ephiperfifo: checksrc compliance 2018-07-29 15:06:00 -04:00
Josh Bialkowski
7f5e570616
docs/examples: add hiperfifo example using linux epoll/timerfd
Closes #2804
2018-07-28 22:34:54 +02:00
Daniel Stenberg
1f6e38e6af
examples/crawler.c: move #ifdef to column 0
Apparently the C => HTML converter on the web site doesn't quite like it
otherwise.

Reported-by: Jeroen Ooms
2018-07-11 11:47:21 +02:00
Marcel Raad
5bd8c389a3
examples: fix -Wformat warnings
When size_t is not a typedef for unsigned long (as usually the case on
Windows), GCC emits -Wformat warnings when using lu and lx format
specifiers with size_t. Silence them with explicit casts to
unsigned long.

Closes https://github.com/curl/curl/pull/2721
2018-07-09 18:08:27 +02:00
Jeroen Ooms
74e0bde773
example/crawler.c: simple crawler based on libxml2
Closes #2706
2018-07-05 15:52:31 +02:00
Viktor Szakats
4bd91bc474 spelling fixes
Detected using the `codespell` tool (version 1.13.0).

Also secure and fix an URL.
2018-06-03 12:14:45 +00:00
Daniel Stenberg
cb529b713f
checksrc: make sure sizeof() is used *with* parentheses
... and unify the source code to adhere.

Closes #2563
2018-05-21 23:21:47 +02:00
Daniel Stenberg
ccf85d4c2b
examples/progressfunc: make it build on older libcurls
This example was changed in ce2140a8c1 to use the new microsecond based
getinfo option. This change makes it conditionally keep using the older
option so that the example still builds with older libcurl versions.

Closes #2584
2018-05-18 13:42:18 +02:00
Philip Prindeville
ce2140a8c1
getinfo: add microsecond precise timers for various intervals
Provide a set of new timers that return the time intervals using integer
number of microseconds instead of floats.

The new info names are as following:

CURLINFO_APPCONNECT_TIME_T
CURLINFO_CONNECT_TIME_T
CURLINFO_NAMELOOKUP_TIME_T
CURLINFO_PRETRANSFER_TIME_T
CURLINFO_REDIRECT_TIME_T
CURLINFO_STARTTRANSFER_TIME_T
CURLINFO_TOTAL_TIME_T

Closes #2495
2018-05-17 13:41:04 +02:00
Rikard Falkeborn
13505dcb55
examples: Fix format specifiers
Closes #2561
2018-05-14 09:43:15 +02:00
Daniel Stenberg
1778135a9f
examples/http2-upload: expand buffer to avoid silly warning
http2-upload.c:135:44: error: ‘%02d’ directive output may be truncated
writing between 2 and 11 bytes into a region of size between 8 and 17
2018-04-24 14:14:23 +02:00
Daniel Stenberg
300f40eb99
examples/sftpuploadresume: typecast fseek argument to long
/docs/examples/sftpuploadresume.c:102:12: warning: conversion to 'long
int' from 'curl_off_t {aka long long int}' may alter its value
2018-04-24 14:11:53 +02:00
Daniel Gustafsson
94400f32e9 all: Refactor malloc+memset to use calloc
When a zeroed out allocation is required, use calloc() rather than
malloc() followed by an explicit memset(). The result will be the
same, but using calloc() everywhere increases consistency in the
codebase and avoids the risk of subtle bugs when code is injected
between malloc and memset by accident.

Closes https://github.com/curl/curl/pull/2497
2018-04-15 03:00:37 -04:00
Jay Satiro
817d1c0106 examples/sftpuploadresmue: Fix Windows large file seek
- Use _fseeki64 instead of fseek (long) to seek curl_off_t in Windows.

- Use CURL_FORMAT_CURL_OFF_T specifier instead of %ld to print
  curl_off_t.

Caught by Marc's CI builds.
2018-04-07 16:03:55 -04:00
Daniel Stenberg
a26d11b8e1
gitignore: ignore more generated files 2018-03-24 00:24:24 +01:00
Jay Satiro
712c916d94 examples/hiperfifo: checksrc compliance 2018-03-20 03:12:35 -04:00
Philip Prindeville
9434194be8
examples/hiperfifo.c: improved
* use member struct event’s instead of pointers to alloc’d struct
   events

 * simplify the cases for the mcode_or_die() function via macros;

 * make multi_timer_cb() actually do what the block comment says it
   should;

 * accept a “stop” command on the FIFO to shut down the service;

 * use cleaner notation for unused variables than the (void) hack;

 * allow following redirections (304’s);
2018-03-16 16:01:01 +01:00
luz.paz
236402fc2d
cleanup: misc typos in strings and comments
Found via `codespell`

Closes #2389
2018-03-16 11:08:31 +01:00
Daniel Stenberg
8b0b1a3088
build: get CFLAGS (including -werror) used for examples and tests
... so that the CI and more detects compiler warnings/errors properly!

Closes #2337
2018-03-04 19:46:26 +01:00
Viktor Szakats
7e35eb7729 spelling fixes
Detected using the `codespell` tool.

Also contains one URL protocol upgrade.

Closes https://github.com/curl/curl/pull/2334
2018-02-23 23:29:01 +00:00
Sergio Borghese
e77f0e5a5a
examples/sftpuploadresume: resume upload via CURLOPT_APPEND
URL: https://curl.haxx.se/mail/lib-2018-02/0072.html
2018-02-20 09:31:06 +01:00
Daniel Stenberg
da07dbb869 examples/url2file.c: add missing curl_global_cleanup() call
Reported-by: XhstormR on github
Fixes #2245
2018-01-18 17:10:34 +01:00
Jay Satiro
d4e40f0690 scripts: allow all perl scripts to be run directly
- Enable execute permission (chmod +x)

- Change interpreter to /usr/bin/env perl

Closes https://github.com/curl/curl/pull/2222
2018-01-07 15:42:11 -05:00
Jay Satiro
a0f3eaf25d examples/cacertinmem: ignore cert-already-exists error
- Ignore X509_R_CERT_ALREADY_IN_HASH_TABLE errors in the CTX callback
  since it's possible the cert may have already been loaded by libcurl.

- Remove the EXAMPLE code in the CURLOPT_SSL_CTX_FUNCTION.3 doc.
  Instead have it direct the reader to this cacertinmem.c example.

- Fix the CA certificate to use the right CA for example.com, Digicert.

Bug: https://curl.haxx.se/mail/lib-2017-12/0057.html
Reported-by: Thomas van Hesteren

Closes https://github.com/curl/curl/pull/2182
2017-12-26 02:08:35 -05:00
Mattias Fornander
b437557896 examples/rtsp: fix error handling macros
Closes https://github.com/curl/curl/pull/2185
2017-12-22 02:59:08 -05:00
Daniel Stenberg
7ef0c2d861
examples/smtp-mail.c: use separate defines for options and mail
... to make it clearer that the options want address-only, while the
headers in an email can also have the real name.

Assisted-by: Sean MacLennan
2017-12-12 15:28:05 +01:00
Daniel Stenberg
bb0ca2d443
examples: move threaded-shared-conn.c to the "complicated" ones
... due it relying on pthreads to link.
2017-12-06 14:49:58 +01:00
Daniel Stenberg
415b8dff8e
threaded-shared-conn.c: fixed typo in commenta 2017-12-05 23:35:08 +01:00
Daniel Stenberg
5254d8bf27
threaded-shared-conn.c: new example 2017-12-05 23:31:47 +01:00
Daniel Stenberg
744ee58386
examples/xmlstream.c: don't switch off CURL_GLOBAL_SSL
Reported-by: Dima Tisnek
2017-12-01 07:52:24 +01:00
Daniel Stenberg
ed22d8654b
examples/rtsp: clear RANGE again after use
Fixes #2106
Reported-by: youngchopin on github
2017-11-23 08:06:44 +01:00
fmmedeiros
297516e12c examples/curlx: Fix code style
- Add braces around multi-line if statement.

Closes https://github.com/curl/curl/pull/2096
2017-11-18 14:04:33 -05:00
Daniel Stenberg
3d1280866a
examples: add shared-connection-cache 2017-11-09 11:07:44 +01:00
Daniel Stenberg
edd1f45c9f
test1554: verify connection cache sharing 2017-11-09 11:07:44 +01:00
Daniel Stenberg
c3e58d93de
examples: bring back curl_formadd-using examples
... now with a -formadd suffix. While the new mime API is introduced in
7.56.0 we must acknowledge that lots of users can't upgrade their curl
versions immediately.
2017-10-03 07:59:55 +02:00
Patrick Monnerat
ee56fdb691 form/mime: field names are not allowed to contain zero-valued bytes.
Also suppress length argument of curl_mime_name() (names are always
zero-terminated).
2017-09-22 01:08:29 +01:00
Marcel Raad
5d916944ae
examples/post-callback: use long for CURLOPT_POSTFIELDSIZE
Otherwise, typecheck-gcc.h warns on MinGW-w64.
2017-09-21 20:07:24 +02:00
Daniel Stenberg
20acb58a38
code style: use space after semicolon 2017-09-12 09:50:24 +02:00
Daniel Stenberg
e5743f08e7
code style: use spaces around pluses 2017-09-11 09:29:50 +02:00
Daniel Stenberg
6b84438d9a
code style: use spaces around equals signs 2017-09-11 09:29:50 +02:00
Viktor Szakats
25fc694a41 examples/mime: minor example code fixes 2017-09-05 10:05:27 +00:00
Viktor Szakats
841a09ea19 mime: use CURL_ZERO_TERMINATED in examples
and some minor whitespace fixes
2017-09-04 13:58:10 +00:00
Daniel Stenberg
12e789391d
examples/post-callback: stop returning one byte at a time
... since people copy and paste code from this example and thus they get
an inefficient POST operation without a good reason and sometimes
without understanding why.

Instead this now returns as much data as possible.
2017-09-04 11:42:00 +02:00