コード例 #1
0
ファイル: tmate-session.c プロジェクト: qrwteyrutiyoup/tmate
void tmate_session_init(void)
{
	tmate_catch_sigsegv();

	tmate_encoder_init(&tmate_session.encoder);
	tmate_decoder_init(&tmate_session.decoder);

	TAILQ_INIT(&tmate_session.clients);

	tmate_session.need_passphrase = 0;
	tmate_session.passphrase = NULL;

	/* The header will be written as soon as the first client connects */
	tmate_write_header();
}
コード例 #2
0
static void __tmate_session_init(struct tmate_session *session,
				 struct event_base *base)
{
	memset(session, 0, sizeof(*session));

	session->ev_base = base;

	/*
	 * Early initialization of encoder because we need to parse
	 * config files to get the server configs, but while we are parsing
	 * config files, we need to buffer bind commands and all for the
	 * slave.
	 * Decoder is setup later.
	 */
	tmate_encoder_init(&session->encoder, NULL, &tmate_session);

	session->min_sx = -1;
	session->min_sy = -1;

	TAILQ_INIT(&session->clients);
}