History log of /curl/lib/asyn-ares.c (Results 1 – 25 of 111)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# e411c98f 11-Apr-2024 Viktor Szakats

build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`)

Before this patch, two macros were used to guard IPv6 features in curl
sources: `ENABLE_IPV6` and `USE_IPV6`. This patch ma

build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`)

Before this patch, two macros were used to guard IPv6 features in curl
sources: `ENABLE_IPV6` and `USE_IPV6`. This patch makes the source use
the latter for consistency with other similar switches.

`-DENABLE_IPV6` remains accepted for compatibility as a synonym for
`-DUSE_IPV6`, when passed to the compiler.

`ENABLE_IPV6` also remains the name of the CMake and `Makefile.vc`
options to control this feature.

Closes #13349

show more ...


# 835e4cb1 26-Feb-2024 Robert Moreton

asyn-ares: fix data race warning

- Store the c-ares version during global init.

Prior to this change several threads could write the same data to a
static int variable at the sa

asyn-ares: fix data race warning

- Store the c-ares version during global init.

Prior to this change several threads could write the same data to a
static int variable at the same time. Though in practice it's not a
problem ThreadSanitizer may warn.

Reported-by: Nikita Taranov
Assisted-by: Jay Satiro

Fixes #13065
Closes #13000

show more ...


# 2cd78f52 29-Feb-2024 RainRat

misc: Fix typos in docs and lib

This fixes miscellaneous typos and duplicated words in the docs, lib
and test comments and a few user facing errorstrings.

Author: RainRat on Git

misc: Fix typos in docs and lib

This fixes miscellaneous typos and duplicated words in the docs, lib
and test comments and a few user facing errorstrings.

Author: RainRat on Github
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Dan Fandrich <dan@coneharvesters.com>
Closes: #13019

show more ...


# 4224d6e0 15-Jan-2024 Lin Sun

asyn-ares: with modern c-ares, use its default timeout

Closes #12703


# cfe79021 08-Jan-2024 Daniel Stenberg

lib: add debug log outputs for CURLE_BAD_FUNCTION_ARGUMENT

Closes #12658


# 907eea08 14-Dec-2023 Daniel Stenberg

Revert "urldata: move async resolver state from easy handle to connectdata"

This reverts commit 56a4db2e4e2bcb9a0dcb75b83560a78ef231fcc8 (#12198)

We want the c-ares channel to be he

Revert "urldata: move async resolver state from easy handle to connectdata"

This reverts commit 56a4db2e4e2bcb9a0dcb75b83560a78ef231fcc8 (#12198)

We want the c-ares channel to be held in the easy handle, not per
connection - for performance.

Closes #12524

show more ...


# 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 ...


# 91188c64 27-Oct-2023 Daniel Stenberg

asyn-ares: handle no connection in the addrinfo callback

To avoid crashing.

Follow-up from 56a4db2
Closes #12219


# 56a4db2e 25-Oct-2023 Stefan Eissing

urldata: move async resolver state from easy handle to connectdata

- resolving is done for a connection, not for every transfer
- save create/dup/free of a cares channel for each transfe

urldata: move async resolver state from easy handle to connectdata

- resolving is done for a connection, not for every transfer
- save create/dup/free of a cares channel for each transfer
- check values of setopt calls against a local channel if no
connection has been attached yet, when needed.

Closes #12198

show more ...


# a181b4a0 28-Aug-2023 Daniel Stenberg

asyn-ares: reduce timeout to 2000ms

When UDP packets get lost this makes for slightly faster retries. This
lower timeout is used by @c-ares itself by default starting next
release.

asyn-ares: reduce timeout to 2000ms

When UDP packets get lost this makes for slightly faster retries. This
lower timeout is used by @c-ares itself by default starting next
release.

Closes #11753

show more ...


# d3142b57 01-Aug-2023 Daniel Stenberg

resolve: use PF_INET6 family lookups when CURL_IPRESOLVE_V6 is set

Previously it would always do PF_UNSPEC if CURL_IPRESOLVE_V4 is not
used, thus unnecessarily asking for addresses that

resolve: use PF_INET6 family lookups when CURL_IPRESOLVE_V6 is set

Previously it would always do PF_UNSPEC if CURL_IPRESOLVE_V4 is not
used, thus unnecessarily asking for addresses that will not be used.

Reported-by: Joseph Tharayil
Fixes #11564
Closes #11565

show more ...


# 2bc1d775 02-Jan-2023 Daniel Stenberg

copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- save

copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205

show more ...


# 2d9fee45 23-Nov-2022 Daniel Gustafsson

netware: remove leftover traces

Commit 3b16575ae938dec2a29454631a12aa52b6ab9c67 removed support for
building on Novell Netware, but a few leftover traces remained. This
removes the l

netware: remove leftover traces

Commit 3b16575ae938dec2a29454631a12aa52b6ab9c67 removed support for
building on Novell Netware, but a few leftover traces remained. This
removes the last bits.

Closes: #9966
Reviewed-by: Daniel Stenberg <daniel@haxx.se>

show more ...


# b563a92c 01-Nov-2022 Viktor Szakats

tidy-up: process.h detection and use

This patch aims to cleanup the use of `process.h` header and the macro
`HAVE_PROCESS_H` associated with it.

- `process.h` is always availabl

tidy-up: process.h detection and use

This patch aims to cleanup the use of `process.h` header and the macro
`HAVE_PROCESS_H` associated with it.

- `process.h` is always available on Windows. In curl, it is required
only for `_beginthreadex()` in `lib/curl_threads.c`.

- `process.h` is also available in MS-DOS. In curl, its only use was in
`lib/smb.c` for `getpid()`. But `getpid()` is in fact declared by
`unistd.h`, which is always enabled via `lib/config-dos.h`. So the
header is not necessary.

- `HAVE_PROCESS_H` was detected by CMake, forced to 1 on Windows and
left to real detection for other platforms.
It was also set to always-on in `lib/config-win32.h` and
`lib/config-dos.h`.
In autotools builds, there was no detection and the macro was never
set.

Based on these observations, in this patch we:

- Rework Windows `getpid` logic in `lib/smb.c` to always use the
equivalent direct Win32 API function `GetCurrentProcessId()`, as we
already did for Windows UWP apps. This makes `process.h` unnecessary
here on Windows.

- Stop #including `process.h` into files where it was not necessary.
This is everywhere, except `lib/curl_threads.c`.

> Strangely enough, `lib/curl_threads.c` compiled fine with autotools
> because `process.h` is also indirecty included via `unistd.h`. This
> might have been broken in autotools MSVC builds, where the latter
> header is missing.

- Delete all remaining `HAVE_PROCESS_H` feature guards, for they were
unnecessary.

- Delete `HAVE_PROCESS_H` detection from CMake and predefined values
from `lib/config-*.h` headers.

Reviewed-by: Jay Satiro
Closes #9703

show more ...


# e71a9b48 10-Oct-2022 bsergean on github

asyn-ares: set hint flags when calling ares_getaddrinfo

The hint flag is ARES_AI_NUMERICSERV, and it will save a call to
getservbyname or getservbyname_r to set it.

Closes #9694


# 46f3fe0e 21-Sep-2022 Daniel Stenberg

hostip: lazily wait to figure out if IPv6 works until needed

The check may take many milliseconds, so now it is performed once the
value is first needed. Also, this change makes sure tha

hostip: lazily wait to figure out if IPv6 works until needed

The check may take many milliseconds, so now it is performed once the
value is first needed. Also, this change makes sure that the value is
not used if the resolve is set to be IPv4-only.

Closes #9553

show more ...


# 1902e8fc 19-Sep-2022 Dmitry Karpov

resolve: make forced IPv4 resolve only use A queries

This protects IPv4-only transfers from undesired bad IPv6-related side
effects and make IPv4 transfers in dual-stack libcurl behave t

resolve: make forced IPv4 resolve only use A queries

This protects IPv4-only transfers from undesired bad IPv6-related side
effects and make IPv4 transfers in dual-stack libcurl behave the same
way as in IPv4 single-stack libcurl.

Closes #9540

show more ...


# 660cf3d4 18-Sep-2022 Daniel Stenberg

lib: the number four in a sequence is the "fourth"

Spelling is hard

Closes #9535


# 14d9d79c 15-Aug-2022 Daniel Stenberg

asyn-ares: make a single alloc out of hostname + async data

This saves one alloc per name resolve and simplifies the exit path.

Closes #9310


# ad9bc597 17-May-2022 max.mehl

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the

copyright: make repository REUSE compliant

Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869

show more ...


# 5912da25 08-Jun-2022 Daniel Stenberg

select: return error from "lethal" poll/select errors

Adds two new error codes: CURLE_UNRECOVERABLE_POLL and
CURLM_UNRECOVERABLE_POLL one each for the easy and the multi interfaces.

select: return error from "lethal" poll/select errors

Adds two new error codes: CURLE_UNRECOVERABLE_POLL and
CURLM_UNRECOVERABLE_POLL one each for the easy and the multi interfaces.

Reported-by: Harry Sintonen
Fixes #8921
Closes #8961

show more ...


# 4ec0549c 25-Apr-2022 Daniel Stenberg

misc: update copyright year ranges


Revision tags: curl-7_76_1, curl-7_76_0, curl-7_75_0, curl-7_74_0, curl-7_73_0
# 68035af2 29-Aug-2020 Marc Hoersken

timediff.[ch]: add curlx helper functions for timeval conversions

Also move timediff_t definitions from timeval.h to timediff.h and
then make timeval.h include the new standalone-capable

timediff.[ch]: add curlx helper functions for timeval conversions

Also move timediff_t definitions from timeval.h to timediff.h and
then make timeval.h include the new standalone-capable timediff.h.

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

Supersedes #5888
Closes #8595

show more ...


# 64e8bf9f 14-Dec-2021 Daniel Stenberg

asyn-ares: ares_getaddrinfo needs no happy eyeballs timer

Closes #8142


12345