Fix concurrent connection issues in wsssht daemon mode

- Implement thread-based concurrent connection handling
- Fix segmentation fault caused by shared static variables
- Each connection now gets its own WebSocket tunnel and resources
- Replace global tunnel management with per-thread instances
- Add proper cleanup for individual connection threads
- Allow multiple SSH sessions to connect simultaneously to the same port
parent 91fe8573
This diff is collapsed.
......@@ -66,6 +66,11 @@ int frame_buffer_resize(frame_buffer_t *fb, size_t new_size);
int frame_buffer_append(frame_buffer_t *fb, const char *data, size_t len);
int frame_buffer_consume(frame_buffer_t *fb, size_t len);
// Helper functions for managing multiple tunnels
tunnel_t *find_tunnel_by_request_id(const char *request_id);
int add_tunnel(tunnel_t *tunnel);
void remove_tunnel(const char *request_id);
void *forward_tcp_to_ws(void *arg);
void *forward_ws_to_local(void *arg);
void *forward_ws_to_ssh_server(void *arg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment