Lines Matching refs:cctx
309 struct mux_session_confirm_ctx *cctx; in process_mux_new_session() local
315 cctx = xcalloc(1, sizeof(*cctx)); in process_mux_new_session()
316 cctx->term = NULL; in process_mux_new_session()
317 cctx->rid = rid; in process_mux_new_session()
320 buffer_get_int_ret(&cctx->want_tty, m) != 0 || in process_mux_new_session()
321 buffer_get_int_ret(&cctx->want_x_fwd, m) != 0 || in process_mux_new_session()
322 buffer_get_int_ret(&cctx->want_agent_fwd, m) != 0 || in process_mux_new_session()
323 buffer_get_int_ret(&cctx->want_subsys, m) != 0 || in process_mux_new_session()
325 (cctx->term = buffer_get_string_ret(m, &len)) == NULL || in process_mux_new_session()
332 if (cctx->term != NULL) in process_mux_new_session()
333 xfree(cctx->term); in process_mux_new_session()
340 cctx->env = NULL; in process_mux_new_session()
352 cctx->env = xrealloc(cctx->env, env_len + 2, in process_mux_new_session()
353 sizeof(*cctx->env)); in process_mux_new_session()
354 cctx->env[env_len++] = cp; in process_mux_new_session()
355 cctx->env[env_len] = NULL; in process_mux_new_session()
365 cctx->want_tty, cctx->want_x_fwd, cctx->want_agent_fwd, in process_mux_new_session()
366 cctx->want_subsys, cctx->term, cmd, env_len); in process_mux_new_session()
368 buffer_init(&cctx->cmd); in process_mux_new_session()
369 buffer_append(&cctx->cmd, cmd, strlen(cmd)); in process_mux_new_session()
381 xfree(cctx->env[j]); in process_mux_new_session()
383 xfree(cctx->env); in process_mux_new_session()
384 xfree(cctx->term); in process_mux_new_session()
385 buffer_free(&cctx->cmd); in process_mux_new_session()
386 xfree(cctx); in process_mux_new_session()
411 xfree(cctx->term); in process_mux_new_session()
414 xfree(cctx->env[i]); in process_mux_new_session()
415 xfree(cctx->env); in process_mux_new_session()
417 buffer_free(&cctx->cmd); in process_mux_new_session()
434 if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1) in process_mux_new_session()
447 if (cctx->want_tty) { in process_mux_new_session()
459 if (cctx->want_tty && escape_char != 0xffffffff) { in process_mux_new_session()
470 channel_register_open_confirm(nc->self, mux_session_confirm, cctx); in process_mux_new_session()
1182 struct mux_session_confirm_ctx *cctx = arg; in mux_session_confirm() local
1188 if (cctx == NULL) in mux_session_confirm()
1201 buffer_put_int(&reply, cctx->rid); in mux_session_confirm()
1207 if (cctx->want_x_fwd && options.forward_x11 && display != NULL) { in mux_session_confirm()
1223 if (cctx->want_agent_fwd && options.forward_agent) { in mux_session_confirm()
1229 client_session2_setup(id, cctx->want_tty, cctx->want_subsys, in mux_session_confirm()
1230 cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env); in mux_session_confirm()
1236 buffer_put_int(&reply, cctx->rid); in mux_session_confirm()
1248 buffer_free(&cctx->cmd); in mux_session_confirm()
1249 xfree(cctx->term); in mux_session_confirm()
1250 if (cctx->env != NULL) { in mux_session_confirm()
1251 for (i = 0; cctx->env[i] != NULL; i++) in mux_session_confirm()
1252 xfree(cctx->env[i]); in mux_session_confirm()
1253 xfree(cctx->env); in mux_session_confirm()
1255 xfree(cctx); in mux_session_confirm()