Lines Matching defs:cctx

310 	struct mux_session_confirm_ctx *cctx;
316 cctx = xcalloc(1, sizeof(*cctx));
317 cctx->term = NULL;
318 cctx->rid = rid;
320 cctx->env = NULL;
323 buffer_get_int_ret(&cctx->want_tty, m) != 0 ||
324 buffer_get_int_ret(&cctx->want_x_fwd, m) != 0 ||
325 buffer_get_int_ret(&cctx->want_agent_fwd, m) != 0 ||
326 buffer_get_int_ret(&cctx->want_subsys, m) != 0 ||
328 (cctx->term = buffer_get_string_ret(m, &len)) == NULL ||
334 free(cctx->env[j]);
335 free(cctx->env);
336 free(cctx->term);
337 free(cctx);
352 cctx->env = xreallocarray(cctx->env, env_len + 2,
353 sizeof(*cctx->env));
354 cctx->env[env_len++] = cp;
355 cctx->env[env_len] = NULL;
365 cctx->want_tty, cctx->want_x_fwd, cctx->want_agent_fwd,
366 cctx->want_subsys, cctx->term, cmd, env_len);
368 buffer_init(&cctx->cmd);
369 buffer_append(&cctx->cmd, cmd, strlen(cmd));
381 free(cctx->env[j]);
382 free(cctx->env);
383 free(cctx->term);
384 buffer_free(&cctx->cmd);
385 free(cctx);
410 free(cctx->term);
413 free(cctx->env[i]);
414 free(cctx->env);
416 buffer_free(&cctx->cmd);
417 free(cctx);
434 if (cctx->want_tty && tcgetattr(new_fd[0], &cctx->tio) == -1)
447 if (cctx->want_tty) {
459 if (cctx->want_tty && escape_char != 0xffffffff) {
470 channel_register_open_confirm(nc->self, mux_session_confirm, cctx);
947 struct mux_stdio_confirm_ctx *cctx;
1027 cctx = xcalloc(1, sizeof(*cctx));
1028 cctx->rid = rid;
1029 channel_register_open_confirm(nc->self, mux_stdio_confirm, cctx);
1040 struct mux_stdio_confirm_ctx *cctx = arg;
1044 if (cctx == NULL)
1045 fatal("%s: cctx == NULL", __func__);
1057 buffer_put_int(&reply, cctx->rid);
1066 buffer_put_int(&reply, cctx->rid);
1078 free(cctx);
1327 struct mux_session_confirm_ctx *cctx = arg;
1333 if (cctx == NULL)
1334 fatal("%s: cctx == NULL", __func__);
1346 buffer_put_int(&reply, cctx->rid);
1352 if (cctx->want_x_fwd && options.forward_x11 && display != NULL) {
1370 if (cctx->want_agent_fwd && options.forward_agent) {
1376 client_session2_setup(id, cctx->want_tty, cctx->want_subsys,
1377 cctx->term, &cctx->tio, c->rfd, &cctx->cmd, cctx->env);
1383 buffer_put_int(&reply, cctx->rid);
1395 buffer_free(&cctx->cmd);
1396 free(cctx->term);
1397 if (cctx->env != NULL) {
1398 for (i = 0; cctx->env[i] != NULL; i++)
1399 free(cctx->env[i]);
1400 free(cctx->env);
1402 free(cctx);