/*
- * Copyright (C) 1997-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2011 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file client.c the client program used to connect to para_server */
#include <regex.h>
-#include <openssl/rc4.h>
#include <stdbool.h>
#include "para.h"
INIT_CLIENT_ERRLISTS;
+static struct sched sched;
static struct client_task *ct;
static struct stdin_task sit;
static struct stdout_task sot;
-static void supervisor_post_select(__a_unused struct sched *s, struct task *t)
+static void supervisor_post_select(struct sched *s, struct task *t)
{
if (ct->task.error < 0) {
t->error = ct->task.error;
}
if (ct->status == CL_SENDING) {
stdin_set_defaults(&sit);
- register_task(&sit.task);
+ register_task(s, &sit.task);
t->error = -E_TASK_STARTED;
return;
}
if (ct->status == CL_RECEIVING) {
stdout_set_defaults(&sot);
- register_task(&sot.task);
+ register_task(s, &sot.task);
t->error = -E_TASK_STARTED;
return;
}
init_random_seed_or_die();
s.default_timeout.tv_sec = 1;
s.default_timeout.tv_usec = 0;
+
/*
* We add buffer tree nodes for stdin and stdout even though
* only one of them will be needed. This simplifies the code
*/
sit.btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "stdin"));
- ret = client_open(argc, argv, &ct, &client_loglevel, sit.btrn, NULL);
+ ret = client_open(argc, argv, &ct, &client_loglevel, sit.btrn, NULL, &sched);
if (ret < 0)
goto out;
sot.btrn = btr_new_node(&(struct btr_node_description)
EMBRACE(.name = "stdout", .parent = ct->btrn));
- register_task(&svt);
- ret = schedule(&s);
+ register_task(&sched, &svt);
+ ret = schedule(&sched);
out:
client_close(ct);
btr_free_node(sit.btrn);