ares_set_notify_pending_write_callback -> ares_set_pending_write_cb

The new notify pending write feature name should be reduced as ISO C
specifies compilers can support unique identifiers of as few as 31
characters.

Since this feature has not yet been made public in a release we
should go ahead and fix this issue so we aren't stuck with it.

Authored-By: Brad House (@bradh352)
pull/871/head
Brad House 3 months ago
parent d543ac438e
commit db9c8e9ad2
  1. 2
      docs/Makefile.inc
  2. 2
      docs/ares_process_pending_write.3
  3. 14
      docs/ares_set_pending_write_cb.3
  4. 8
      include/ares.h
  5. 5
      src/lib/ares__socket.c
  6. 2
      src/lib/ares_private.h

@ -130,7 +130,7 @@ MANPAGES = ares_cancel.3 \
ares_set_local_dev.3 \
ares_set_local_ip4.3 \
ares_set_local_ip6.3 \
ares_set_notify_pending_write_callback.3 \
ares_set_pending_write_cb.3 \
ares_set_server_state_callback.3 \
ares_set_servers.3 \
ares_set_servers_csv.3 \

@ -1,3 +1,3 @@
.\" Copyright (C) 2023 The c-ares project and its contributors.
.\" SPDX-License-Identifier: MIT
.so man3/ares_set_notify_pending_write_callback.3
.so man3/ares_set_pending_write_cb.3

@ -4,26 +4,26 @@
.\"
.TH ARES_SET_NOTIFY_PENDING_WRITE_CALLBACK 3 "13 Aug 2024"
.SH NAME
ares_set_notify_pending_write_callback, ares_process_pending_write \- Function
ares_set_pending_write_cb, ares_process_pending_write \- Function
for setting a callback which is triggered when there is potential pending data
which needs to be written.
.SH SYNOPSIS
.nf
#include <ares.h>
typedef void (*ares_notify_pending_write_callback)(void *\fIdata\fP);
typedef void (*ares_pending_write_cb)(void *\fIdata\fP);
void ares_set_notify_pending_write_callback(
ares_channel_t *\fIchannel\fP,
ares_notify_pending_write_callback \fIcallback\fP,
void *\fIuser_data\fP);
void ares_set_pending_write_cb(
ares_channel_t *\fIchannel\fP,
ares_pending_write_cb \fIcallback\fP,
void *\fIuser_data\fP);
void ares_process_pending_write(ares_channel_t *\fIchannel\fP);
.fi
.SH DESCRIPTION
The \fBares_set_notify_pending_write_callback(3)\fP function sets a callback
The \fBares_set_pending_write_cb(3)\fP function sets a callback
function \fIcallback\fP in the given ares channel handle \fIchannel\fP that
is invoked whenever there is new pending TCP data to be written. Since TCP
is stream based, if there are multiple queries being enqueued back to back they

@ -460,7 +460,7 @@ typedef void (*ares_server_state_callback)(const char *server_string,
ares_bool_t success, int flags,
void *data);
typedef void (*ares_notify_pending_write_callback)(void *data);
typedef void (*ares_pending_write_cb)(void *data);
CARES_EXTERN int ares_library_init(int flags);
@ -528,9 +528,9 @@ CARES_EXTERN void
ares_server_state_callback callback,
void *user_data);
CARES_EXTERN void ares_set_notify_pending_write_callback(
ares_channel_t *channel, ares_notify_pending_write_callback callback,
void *user_data);
CARES_EXTERN void ares_set_pending_write_cb(ares_channel_t *channel,
ares_pending_write_cb callback,
void *user_data);
CARES_EXTERN void ares_process_pending_write(ares_channel_t *channel);

@ -1161,9 +1161,8 @@ void ares_set_socket_functions(ares_channel_t *channel,
channel->sock_func_cb_data = data;
}
void ares_set_notify_pending_write_callback(
ares_channel_t *channel, ares_notify_pending_write_callback callback,
void *user_data)
void ares_set_pending_write_cb(ares_channel_t *channel,
ares_pending_write_cb callback, void *user_data)
{
if (channel == NULL || channel->optmask & ARES_OPT_EVENT_THREAD) {
return;

@ -410,7 +410,7 @@ struct ares_channeldata {
const struct ares_socket_functions *sock_funcs;
void *sock_func_cb_data;
ares_notify_pending_write_callback notify_pending_write_cb;
ares_pending_write_cb notify_pending_write_cb;
void *notify_pending_write_cb_data;
ares_bool_t notify_pending_write;

Loading…
Cancel
Save