Skip to content

Commit

Permalink
minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh352 committed Aug 13, 2024
1 parent 4c7687d commit c975cd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ares_set_notify_pending_write_callback.3
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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
can be sent as one large buffer. Normally a \fBsend(2)\fP syscall operation
would triggered for each query.
would be triggered for each query.

When setting this callback, an event will be triggered when data is buffered,
but not written. This event is used to wake the caller's event loop which
Expand Down
5 changes: 5 additions & 0 deletions src/lib/ares_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ static void write_tcp_data(ares_channel_t *channel, fd_set *write_fds,
{
ares__slist_node_t *node;

/* no possible action */
if (write_fds == NULL && write_fd == ARES_SOCKET_BAD) {
return;
}

for (node = ares__slist_node_first(channel->servers); node != NULL;
node = ares__slist_node_next(node)) {
ares_server_t *server = ares__slist_node_val(node);
Expand Down

0 comments on commit c975cd1

Please sign in to comment.