int s2n_shutdown(struct s2n_connection *conn, int *more) { /* Write any pending I/O */ GUARD(s2n_flush(conn, more)); GUARD(s2n_queue_writer_close_alert(conn)); /* Write the alert message out */ GUARD(s2n_flush(conn, more)); /* Wipe the connection */ GUARD(s2n_connection_wipe(conn)); return 0; }
int s2n_shutdown(struct s2n_connection *conn, s2n_blocked_status *more) { uint64_t elapsed; GUARD(s2n_timer_elapsed(conn->config, &conn->write_timer, &elapsed)); if (elapsed < conn->delay) { S2N_ERROR(S2N_ERR_SHUTDOWN_PAUSED); } /* Write any pending I/O */ GUARD(s2n_flush(conn, more)); GUARD(s2n_queue_writer_close_alert(conn)); /* Write the alert message out */ GUARD(s2n_flush(conn, more)); /* Wipe the connection */ GUARD(s2n_connection_wipe(conn)); return 0; }