- handle_data: добавить pc->tun_closed в проверку сброса данных от exit
- proxy_feed_from_transport: не писать в PCB после tun_closed
- предотвращает ERR_RST (-14) при записи в TIME_WAIT PCB
- link_status теперь требует двусторонней слышимости: remote && local
- recv_keepalive восстанавливается ДО вычисления link_status (избегает заклинивания)
- loadbalancer_link_ready по переходу 0→1 с проверкой was_up
- ROUTER_SEQ_CLOSE_FLAG (0x80000000): normal conn close
- ROUTER_SEQ_RST_FLAG (0x40000000): conn not found
- router_send_to(): SVC_ROUTE with flags, no conn needed
- router_send_close_to_service(): notify local service [svc_id],len=1
- router_close_and_notify(): CLOSE to remote + close to local + cleanup
- etcp_router_conn_close(): sends CLOSE to remote before cleanup
- etcp_router_conn_close_all_for_node(): close all conns for dead peer
- recv_cb: flags checked only when pl_len==0 (avoid seq collision)
- etcp_router_destroy: close notification to each service
- New SVC_ROUTE_HDR (packed struct, 22 bytes): cmd+dst+src+seq+svc_id
- ETCP_ROUTER_CONN: state per (remote_node_id, svc_id), hash-indexed in router_conns
- Reorder via recv_q (hash by seq), dedup with 32-bit circular compare
- Periodic ACK (100ms), idle ACK (500ms), inflight limit via tx_seq - rx_acked
- Legacy mode: no conn → direct delivery without reorder
- etcp_router_conn_get/send/close API for seq-managed connections
- Unit test test_etcp_router_unit: 18 tests, 3ms, no ETCP/sockets/BGP
- remove sock_transport, transport abstraction, active connections API
- simplify proxy_conn to 13 fields (was 15), remove tcp_proxy_mapping linked list
- new protocol: stream_id 4B, seq 2B cyclic, HDR_SIZE 8B
- add ERROR subcmd for immediate abort, CLOSE for graceful half-close
- proper half-close: shutdown SHUT_WR, keep reading, no timer
- exhaustive DEBUG_ERROR/WARN on all error/unusual branches
- config parser: report unknown options with filename:line and valid keys
- proxy_uip_retry_cb: retry send from uip_to_transport every 5ms
- proxy_recv_cb: buffer to uip_to_transport when send fails, set retry timer
- proxy_feed: drain transport_to_uip when closing_tun || closing_sent (prevents RST)
- proxy_recv_cb(p==NULL): only tcp_recved + closing_tun, no drain
- proxy_poll_cb/tcp_proxy_destroy: cancel retry timer on cleanup
- uip_retry_timer field in proxy_conn
- proxy_recv_cb(p==NULL): tcp_recved(pcb,gap) before closing_tun
- proxy_feed_from_transport: stop when closing_sent
- proxy_poll_cb cleanup: free unsent before tcp_close
- proxy_try_close helper: shared between poll_cb (500ms) and recv_cb
- pending_out check: don't close if data still queued for exit
- Configs: traffic=info, tun=info for diagnostics
- Add closing_sent flag to proxy_conn (CLOSE sent to exit, no need to wait for reply)
- proxy_poll_cb: send CLOSE when done || sndbuf==0; cleanup when tun && (rem||sent)
- Destroy transport in proxy_poll_cb cleanup (fix 56-byte leak)
- remote_proxy_handle_close: shutdown(SHUT_WR) + 2s timer instead of immediate rp_conn_free
- Remove SHUTDOWN subcommand entirely (not needed with new lifecycle)
- proxy_recv_cb(p=NULL): now calls transport->close() to signal exit side
- Add PROXY FIN/CLOSE/CONNECTED/DATA/FEED/TCP_IN/TCP_OUT logs
- Add RP RECV/SEND/CLOSE logs on exit side
- Fix queue_dgram_free/queue_entry_free ordering (UAF) in all proxy files
- Change TRAFFIC logs from ERROR to INFO level
- Add 2 extra 1MB tests in run_test.sh to verify no post-stress stall
- stress_client.py: add --verbose per-thread timing (connect/send/recv ms)
- mem.c: zero freed memory for early UAF detection