History log of /curl/src/tool_operate.c (Results 1 – 25 of 469)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 00bef959 20-Apr-2024 Gusted

tool_operate: don't truncate the etag save file by default

This fixes a regression of 75d79a4486b279100209ddf8c7fdb12955fb66e9. The
code in tool-operate truncated the etag save file, und

tool_operate: don't truncate the etag save file by default

This fixes a regression of 75d79a4486b279100209ddf8c7fdb12955fb66e9. The
code in tool-operate truncated the etag save file, under the assumption
that the file would be written with a new etag value. However since
75d79a4486b279100209ddf8c7fdb12955fb66e9 that might not be the case
anymore and could result in the file being truncated when --etag-compare
and --etag-save was used and that the etag value matched with what the
server responded. Instead the truncation should not be done when a new
etag value should be written.

Test 3204 was added to verify that the file with the etag value doesn't
change the contents when used by --etag-compare and --etage-save and
that value matches with what the server returns on a non 2xx response.

Closes #13432

show more ...


# 5fa594ab 20-Apr-2024 Daniel Stenberg

tool_operate: init vars unconditionally in post_per_transfer

In case of (the unlikely) early return, they could otherwise remain
uninitialized

Spotted by CodeSonar

Clos

tool_operate: init vars unconditionally in post_per_transfer

In case of (the unlikely) early return, they could otherwise remain
uninitialized

Spotted by CodeSonar

Closes #13430

show more ...


# a362962b 04-Apr-2024 Stephen Farrell

TLS: add support for ECH (Encrypted Client Hello)

An EXPERIMENTAL feature used with CURLOPT_ECH and --ech.

Closes #11922


# aba80430 30-Mar-2024 Daniel Stenberg

tool: follow-up getenv fix

Remove a double free. Change the IPFS env use to a plain getenv() simply
because coverity gets confused.

Follow-up to 9126b141c9398fe
Closes #13241


# 9126b141 30-Mar-2024 Daniel Stenberg

curl: use curl_getenv instead of the curlx_ version

The curlx one was once introduced when we still considered dropping the
libcurl function at some point. To reduce confusion and to mak

curl: use curl_getenv instead of the curlx_ version

The curlx one was once introduced when we still considered dropping the
libcurl function at some point. To reduce confusion and to make it
easier to understand when curl_free() should be used, use the actual
libcurl function call directly instead.

Closes #13230

show more ...


# 40948189 14-Mar-2024 Daniel Stenberg

curl: make --libcurl output better CURLOPT_*SSLVERSION

The option is really two enums ORed together, so it needs special
attention to make the code output nice.

Added test 1481

curl: make --libcurl output better CURLOPT_*SSLVERSION

The option is really two enums ORed together, so it needs special
attention to make the code output nice.

Added test 1481 to verify. Both the server and the proxy versions.

Reported-by: Boris Verkhovskiy
Fixes #13127
Closes #13129

show more ...


# 924e264b 05-Feb-2024 Daniel Stenberg

tool_operate: change precedence of server Retry-After time

- When calculating the retry time, no longer allow a server's requested
Retry-After time to take precedence over a longer ret

tool_operate: change precedence of server Retry-After time

- When calculating the retry time, no longer allow a server's requested
Retry-After time to take precedence over a longer retry time (either
default algorithmic or user-specified).

Prior to this change the server's Retry-After time took precedence over
curl's retry time in all cases, but that's not always practical for
short Retry-After times depending on how busy the server is.

Bug: https://curl.se/mail/archive-2024-01/0022.html
Reported-by: Dirk Hünniger

Closes https://github.com/curl/curl/pull/12871

show more ...


# 2f3e7a26 01-Feb-2024 Daniel Stenberg

tool_operate: do not set CURLOPT_QUICK_EXIT in debug builds

Since it allows (small) memory leaks that interfere with torture tests
and regular memory-leak checks.

Reported-by: D

tool_operate: do not set CURLOPT_QUICK_EXIT in debug builds

Since it allows (small) memory leaks that interfere with torture tests
and regular memory-leak checks.

Reported-by: Dan Fandrich
Fixes #12834
Closes #12835

show more ...


# ae9f01f3 15-Jan-2024 Daniel Stenberg

tool_operate: make --remove-on-error only remove "real" files

Reported-by: Harry Sintonen
Assisted-by: Dan Fandrich

Closes #12710


# ba01cac3 15-Jan-2024 Daniel Stenberg

tool_operate: stop setting the file comment on Amiga

- the URL is capped at 80 cols, which ruins it if longer
- it does not strip off URL credentials
- it is done unconditonally, not

tool_operate: stop setting the file comment on Amiga

- the URL is capped at 80 cols, which ruins it if longer
- it does not strip off URL credentials
- it is done unconditonally, not on --xattr
- we don't have Amiga in the CI which makes fixing it blindly fragile

Someone who builds and tests on Amiga can add it back correctly in a
future if there is a desire.

Reported-by: Harry Sintonen
Closes #12709

show more ...


# 1f4433da 08-Jan-2024 Daniel Stenberg

tool_getparam: build post data using dynbuf (more)


# 1dba44b2 08-Jan-2024 Daniel Stenberg

tool_getparam: replace malloc + copy by dynbuf for --data


# e9a7d4a1 21-Nov-2023 Viktor Szakats

windows: use built-in `_WIN32` macro to detect Windows

Windows compilers define `_WIN32` automatically. Windows SDK headers
or build env defines `WIN32`, or we have to take care of it. T

windows: use built-in `_WIN32` macro to detect Windows

Windows compilers define `_WIN32` automatically. Windows SDK headers
or build env defines `WIN32`, or we have to take care of it. The
agreement seems to be that `_WIN32` is the preferred practice here.
Make the source code rely on that to detect we're building for Windows.

Public `curl.h` was using `WIN32`, `__WIN32__` and `CURL_WIN32` for
Windows detection, next to the official `_WIN32`. After this patch it
only uses `_WIN32` for this. Also, make it stop defining `CURL_WIN32`.

There is a slight chance these break compatibility with Windows
compilers that fail to define `_WIN32`. I'm not aware of any obsolete
or modern compiler affected, but in case there is one, one possible
solution is to define this macro manually.

grepping for `WIN32` remains useful to discover Windows-specific code.

Also:

- extend `checksrc` to ensure we're not using `WIN32` anymore.

- apply minor formatting here and there.

- delete unnecessary checks for `!MSDOS` when `_WIN32` is present.

Co-authored-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Closes #12376

show more ...


# bc8509a7 07-Nov-2023 Sam James

misc: fix -Walloc-size warnings

GCC 14 introduces a new -Walloc-size included in -Wextra which gives:

```
src/tool_operate.c: In function ‘add_per_transfer’:
src/tool_operat

misc: fix -Walloc-size warnings

GCC 14 introduces a new -Walloc-size included in -Wextra which gives:

```
src/tool_operate.c: In function ‘add_per_transfer’:
src/tool_operate.c:213:5: warning: allocation of insufficient size ‘1’ for type ‘struct per_transfer’ with size ‘480’ [-Walloc-size]
213 | p = calloc(sizeof(struct per_transfer), 1);
| ^
src/var.c: In function ‘addvariable’:
src/var.c:361:5: warning: allocation of insufficient size ‘1’ for type ‘struct var’ with size ‘32’ [-Walloc-size]
361 | p = calloc(sizeof(struct var), 1);
| ^
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the
prototype, as we're initialising 1 struct of size `sizeof(struct
...)`. GCC then sees we're not doing anything wrong.

Closes #12292

show more ...


# 01d9b8bc 06-Nov-2023 Daniel Stenberg

curl: move IPFS code into src/tool_ipfs.[ch]

- convert ensure_trailing into ensure_trailing_slash
- strdup the URL string to own it proper
- use shorter variable names
- combine

curl: move IPFS code into src/tool_ipfs.[ch]

- convert ensure_trailing into ensure_trailing_slash
- strdup the URL string to own it proper
- use shorter variable names
- combine some expressions
- simplify error handling in ipfs_gateway()
- add MAX_GATEWAY_URL_LEN + proper bailout if maximum is reached
- ipfs-gateway.d polish and simplification
- shorten ipfs error message + make them "synthetic"

Closes #12281

show more ...


# ba281e5c 06-Nov-2023 Daniel Stenberg

tool_operate: do not mix memory models

Make sure 'inputpath' only points to memory allocated by libcurl so that
curl_free works correctly.

Pointed out by Coverity

Follo

tool_operate: do not mix memory models

Make sure 'inputpath' only points to memory allocated by libcurl so that
curl_free works correctly.

Pointed out by Coverity

Follow-up to 859e88f6533f9e1f890

Closes #12280

show more ...


# 859e88f6 18-Oct-2023 Mark Gaiser

curl: improved IPFS and IPNS URL support

Previously just ipfs://<cid> and ipns://<cid> was supported, which is
too strict for some usecases.

This patch allows paths and query ar

curl: improved IPFS and IPNS URL support

Previously just ipfs://<cid> and ipns://<cid> was supported, which is
too strict for some usecases.

This patch allows paths and query arguments to be used too.
Making this work according to normal http semantics:

ipfs://<cid>/foo/bar?key=val
ipns://<cid>/foo/bar?key=val

The gateway url support is changed.
It now only supports gateways in the form of:

http://<gateway>/foo/bar
http://<gateway>

Query arguments here are explicitly not allowed and trigger an intended
malformed url error.

There also was a crash when IPFS_PATH was set with a non trailing
forward slash. This has been fixed.

Lastly, a load of test cases have been added to verify the above.

Reported-by: Steven Allen
Fixes #12148
Closes #12152

show more ...


# 014ce7c0 11-Oct-2023 Loïc Yhuel

tool: fix --capath when proxy support is disabled

After 95e8515ca0, --capath always sets CURLOPT_PROXY_CAPATH, which fails
with CURLE_UNKNOWN_OPTION when proxy support is disabled.

tool: fix --capath when proxy support is disabled

After 95e8515ca0, --capath always sets CURLOPT_PROXY_CAPATH, which fails
with CURLE_UNKNOWN_OPTION when proxy support is disabled.

Closes #12089

show more ...


# 7f7fa2fd 15-Oct-2023 Marcin Rataj

tool_operate: fix links in ipfs errors

URL fragment links generated from headers in
https://curl.se/docs/ipfs.html are lowercase.

Closes #12133


# e5bb88b8 28-Sep-2023 Viktor Szakats

tool: use our own stderr variable

Earlier this year we changed our own stderr variable to use the standard
name `stderr` (to avoid bugs where someone is using `stderr` instead of
the

tool: use our own stderr variable

Earlier this year we changed our own stderr variable to use the standard
name `stderr` (to avoid bugs where someone is using `stderr` instead of
the curl-tool specific variable). This solution needed to override the
standard `stderr` symbol via the preprocessor. This in turn didn't play
well with unity builds and caused curl tool to crash or stay silent due
to an uninitialized stderr. This was a hard to find issue, fixed by
manually breaking out one file from the unity sources.

To avoid two these two tricks, this patch implements a different
solution: Restore using our own local variable for our stderr output and
leave `stderr` as-is. To avoid using `stderr` by mistake, add a
`checksrc` rule (based on logic we already used in lib for `strerror`)
that detects any `stderr` use in `src` and points to using our own
variable instead: `tool_stderr`.

Follow-up to 06133d3e9b8aeb9e9ca0b3370c246bdfbfc8619e
Follow-up to 2f17a9b654121dd1ecf4fc043c6d08a9da3522db

Closes #11958

show more ...


# a35e2dd6 28-Sep-2023 Daniel Stenberg

tool_operate: free 'gateway' correctly

Pointed out by Coverity. The fix in 93885cf3a8d4e was incomplete.

Also removed repeated wording in IPFS related error messages.

Close

tool_operate: free 'gateway' correctly

Pointed out by Coverity. The fix in 93885cf3a8d4e was incomplete.

Also removed repeated wording in IPFS related error messages.

Closes #11969

show more ...


# c50cbac0 27-Sep-2023 Daniel Stenberg

tool_operate: avoid strlen() -1 on zero length content from file

Follow-up to 65b563a96a226649ba12cb1e

Closes #11959


# 93885cf3 27-Sep-2023 Daniel Stenberg

tool_operate: fix memory mixups

Switch to plain getenv() from curl_getenv() to avoid the allocation and
having to keep track of which free() or curl_free() that need to be
used.

tool_operate: fix memory mixups

Switch to plain getenv() from curl_getenv() to avoid the allocation and
having to keep track of which free() or curl_free() that need to be
used.

Coverity found issues and a memory leak.

Follow-up to 65b563a96a226649ba12cb1e

Closes #11959

show more ...


# 65b563a9 27-Mar-2022 Mark Gaiser

curl: add support for the IPFS protocols:

- ipfs://<cid>
- ipns://<cid>

This allows you tu use ipfs in curl like:
curl ipfs://<cid>
and
curl ipns://<cid>

Fo

curl: add support for the IPFS protocols:

- ipfs://<cid>
- ipns://<cid>

This allows you tu use ipfs in curl like:
curl ipfs://<cid>
and
curl ipns://<cid>

For more information consult the readme at:
https://curl.se/docs/ipfs.html

Closes #8805

show more ...


# c5a96307 07-Sep-2023 Daniel Stenberg

tool_operate: make aws-sigv4 not require TLS to be used

Maybe not used too often, but we want it for testing and it should work.


12345678910>>...19