struct pl_tls_sess_data {
PROTOLAYER_DATA_HEADER();
bool client_side;
+ bool first_handshake_done;
gnutls_session_t tls_session;
tls_hs_state_t handshake_state;
protolayer_iter_ctx_queue_t unwrap_queue;
}
}
}
- session2_event_after(session, PROTOLAYER_TLS, PROTOLAYER_EVENT_CONNECT, NULL);
+ if (!tls->first_handshake_done) {
+ session2_event_after(session, PROTOLAYER_TLS,
+ PROTOLAYER_EVENT_CONNECT, NULL);
+ tls->first_handshake_done = true;
+ }
}
/** Perform TLS handshake and handle error codes according to the documentation.
session2_event(session, PROTOLAYER_EVENT_CONNECT, NULL);
session2_start_read(session);
-
- int ret = send_waiting(session);
- if (ret != 0) {
- return;
- }
-
session2_timer_stop(session);
session2_timer_start(session, PROTOLAYER_EVENT_GENERAL_TIMEOUT,
MAX_TCP_INACTIVITY, MAX_TCP_INACTIVITY);
}
worker_add_tcp_connected(peer, session);
+
+ send_waiting(session);
return PROTOLAYER_EVENT_PROPAGATE;
}