Lines Matching refs:cctx
4532 connect_next(struct channel_connect *cctx) in connect_next() argument
4539 for (; cctx->ai; cctx->ai = cctx->ai->ai_next) { in connect_next()
4540 switch (cctx->ai->ai_family) { in connect_next()
4543 sunaddr = (struct sockaddr_un *)cctx->ai->ai_addr; in connect_next()
4549 if (getnameinfo(cctx->ai->ai_addr, cctx->ai->ai_addrlen, in connect_next()
4560 cctx->host, ntop, strport); in connect_next()
4561 if ((sock = socket(cctx->ai->ai_family, cctx->ai->ai_socktype, in connect_next()
4562 cctx->ai->ai_protocol)) == -1) { in connect_next()
4563 if (cctx->ai->ai_next == NULL) in connect_next()
4571 if (connect(sock, cctx->ai->ai_addr, in connect_next()
4572 cctx->ai->ai_addrlen) == -1 && errno != EINPROGRESS) { in connect_next()
4574 cctx->host, ntop, strport, strerror(errno)); in connect_next()
4580 if (cctx->ai->ai_family != AF_UNIX) in connect_next()
4583 cctx->host, ntop, strport, sock); in connect_next()
4584 cctx->ai = cctx->ai->ai_next; in connect_next()
4591 channel_connect_ctx_free(struct channel_connect *cctx) in channel_connect_ctx_free() argument
4593 free(cctx->host); in channel_connect_ctx_free()
4594 if (cctx->aitop) { in channel_connect_ctx_free()
4595 if (cctx->aitop->ai_family == AF_UNIX) in channel_connect_ctx_free()
4596 free(cctx->aitop); in channel_connect_ctx_free()
4598 freeaddrinfo(cctx->aitop); in channel_connect_ctx_free()
4600 memset(cctx, 0, sizeof(*cctx)); in channel_connect_ctx_free()
4609 char *ctype, char *rname, struct channel_connect *cctx, in connect_to_helper() argument
4641 cctx->aitop = ai; in connect_to_helper()
4647 if ((gaierr = getaddrinfo(name, strport, &hints, &cctx->aitop)) in connect_to_helper()
4659 cctx->host = xstrdup(name); in connect_to_helper()
4660 cctx->port = port; in connect_to_helper()
4661 cctx->ai = cctx->aitop; in connect_to_helper()
4663 if ((sock = connect_next(cctx)) == -1) { in connect_to_helper()
4677 struct channel_connect cctx; in connect_to() local
4681 memset(&cctx, 0, sizeof(cctx)); in connect_to()
4683 &cctx, NULL, NULL); in connect_to()
4685 channel_connect_ctx_free(&cctx); in connect_to()
4692 c->connect_ctx = cctx; in connect_to()
4758 struct channel_connect cctx; in channel_connect_to_port() local
4795 memset(&cctx, 0, sizeof(cctx)); in channel_connect_to_port()
4797 &cctx, reason, errmsg); in channel_connect_to_port()
4799 channel_connect_ctx_free(&cctx); in channel_connect_to_port()
4807 c->connect_ctx = cctx; in channel_connect_to_port()
4908 struct channel_connect cctx; in rdynamic_connect_finish() local
4927 memset(&cctx, 0, sizeof(cctx)); in rdynamic_connect_finish()
4929 NULL, &cctx, NULL, NULL); in rdynamic_connect_finish()
4931 channel_connect_ctx_free(&cctx); in rdynamic_connect_finish()
4935 c->connect_ctx = cctx; in rdynamic_connect_finish()