{
struct client_task *ct = container_of(t, struct client_task, task);
struct btr_node *btrn = ct->btrn;
{
struct client_task *ct = container_of(t, struct client_task, task);
struct btr_node *btrn = ct->btrn;
switch (ct->status) {
case CL_CONNECTED: /* receive welcome message */
ret = client_recv_buffer(ct, &s->rfds, buf, sizeof(buf), &n);
switch (ct->status) {
case CL_CONNECTED: /* receive welcome message */
ret = client_recv_buffer(ct, &s->rfds, buf, sizeof(buf), &n);
case CL_RECEIVED_WELCOME: /* send auth command */
if (!FD_ISSET(ct->scc.fd, &s->wfds))
case CL_RECEIVED_WELCOME: /* send auth command */
if (!FD_ISSET(ct->scc.fd, &s->wfds))
if (has_feature("sideband", ct)) {
ct->use_sideband = true;
sprintf(buf, AUTH_REQUEST_MSG "%s sideband", ct->user);
if (has_feature("sideband", ct)) {
ct->use_sideband = true;
sprintf(buf, AUTH_REQUEST_MSG "%s sideband", ct->user);
hash_to_asc(ct->challenge_hash, buf);
PARA_INFO_LOG("--> %s\n", buf);
ct->status = CL_RECEIVED_CHALLENGE;
hash_to_asc(ct->challenge_hash, buf);
PARA_INFO_LOG("--> %s\n", buf);
ct->status = CL_RECEIVED_CHALLENGE;
if (!strstr(buf, PROCEED_MSG))
goto out;
ct->status = CL_RECEIVED_PROCEED;
if (!strstr(buf, PROCEED_MSG))
goto out;
ct->status = CL_RECEIVED_PROCEED;
}
case CL_RECEIVED_PROCEED: /* concat args and send command */
{
int i;
char *command = NULL;
if (!FD_ISSET(ct->scc.fd, &s->wfds))
}
case CL_RECEIVED_PROCEED: /* concat args and send command */
{
int i;
char *command = NULL;
if (!FD_ISSET(ct->scc.fd, &s->wfds))
}
ct->status = CL_RECEIVING;
btr_add_output(buf2, n, btrn);
}
ct->status = CL_RECEIVING;
btr_add_output(buf2, n, btrn);
sz = btr_next_buffer(btrn, &buf2);
ret = sc_send_bin_buffer(&ct->scc, buf2, sz);
if (ret < 0)
goto out;
btr_consume(btrn, sz);
sz = btr_next_buffer(btrn, &buf2);
ret = sc_send_bin_buffer(&ct->scc, buf2, sz);
if (ret < 0)
goto out;
btr_consume(btrn, sz);
/*
* The FD_ISSET() is not strictly necessary, but is allows us
* to skip the malloc below if there is nothing to read anyway.
*/
if (!FD_ISSET(ct->scc.fd, &s->rfds))
/*
* The FD_ISSET() is not strictly necessary, but is allows us
* to skip the malloc below if there is nothing to read anyway.
*/
if (!FD_ISSET(ct->scc.fd, &s->rfds))
ct->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "client", .parent = parent, .child = child));
ct->task.pre_select = client_pre_select;
ct->btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "client", .parent = parent, .child = child));
ct->task.pre_select = client_pre_select;
ct->task.error = 0;
sprintf(ct->task.status, "client");
register_task(s, &ct->task);
ct->task.error = 0;
sprintf(ct->task.status, "client");
register_task(s, &ct->task);