Preserve cancellation of pending outgoing attempts and size packet fixture correctly
This commit is contained in:
1 parent
b57221f6b5
commit
2e66cdb122
2 files changed
+2
-2
No files matched your search
@@ -1140,7 +1140,7 @@ static void ncd_handle_close(struct NODE_CONN_DIRECT* h, int force) {
|
||||
(unsigned long long)entry->node_id, entry->handle_count, force);
|
||||
if (entry->handle_count || entry->closed) { ncd_collect(entry); return; }
|
||||
struct ETCP_CONN* conn = entry->conn;
|
||||
if (force || !conn || conn->close_requested || conn->state == 2 || entry->timed_out) {
|
||||
if (force || !conn || conn->close_requested || conn->state == 2 || entry->timed_out || (!conn->state && !conn->links_up)) {
|
||||
ncd_finish(entry, 1); return;
|
||||
}
|
||||
if (!conn->links_up) {
|
||||
|
||||
@@ -40,7 +40,7 @@ static void setup(void) {
|
||||
inst.ua = uasync_create(); CHECK(inst.ua); inst.config = &cfg;
|
||||
cfg.global.bbr_max_cwnd = 100000; cfg.global.keepalive_interval = 200; cfg.global.keepalive_timeout = 2000;
|
||||
inst.connections = queue_new(inst.ua, 16, 0, 8, "server lifecycle"); CHECK(inst.connections);
|
||||
inst.pkt_pool = memory_pool_init(sizeof(struct ETCP_DGRAM), "server lifecycle packets"); CHECK(inst.pkt_pool);
|
||||
inst.pkt_pool = memory_pool_init(sizeof(struct ETCP_DGRAM) + PACKET_DATA_SIZE, "server lifecycle packets"); CHECK(inst.pkt_pool);
|
||||
sock.instance = &inst; strcpy(sock.name, "synthetic server");
|
||||
CHECK(init_connections(&inst) == 0); // чисто входящий узел тоже принимает NCD CLOSE
|
||||
CHECK(inst.ncd_control_bound && !inst.ncd_registry);
|
||||
|
||||
Reference in new issue
Block a user