mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2026-10-05 07:10:24 +00:00
Three fixes in one commit (sorry): a) Take care of the tcpbuf if it ends while queued for transmission, note broken servers and close them in the main loop, and store TCP socket generation number in order not to send the same query twice over the same socket.
This commit is contained in:
@@ -136,6 +136,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->nservers = -1;
|
||||
channel->ndomains = -1;
|
||||
channel->nsort = -1;
|
||||
channel->tcp_connection_generation = 0;
|
||||
channel->lookups = NULL;
|
||||
channel->queries = NULL;
|
||||
channel->domains = NULL;
|
||||
@@ -201,10 +202,12 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
server = &channel->servers[i];
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_connection_generation = ++channel->tcp_connection_generation;
|
||||
server->tcp_lenbuf_pos = 0;
|
||||
server->tcp_buffer = NULL;
|
||||
server->qhead = NULL;
|
||||
server->qtail = NULL;
|
||||
server->is_broken = 0;
|
||||
}
|
||||
|
||||
init_id_key(&channel->id_key, ARES_ID_KEY_LEN);
|
||||
|
||||
Reference in New Issue
Block a user