X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=client_common.c;h=a3a471aedaab1f79a3f3091bf61572a716248598;hb=36ba180901dd97003208ee6c51b0795cf351cb03;hp=649a1b4fdf49579e653d7b6cd6d9c977524e6171;hpb=02dd632ab2a6696aff7b6c6d108069704cfe871a;p=paraslash.git diff --git a/client_common.c b/client_common.c index 649a1b4f..a3a471ae 100644 --- a/client_common.c +++ b/client_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2012 Andre Noll + * Copyright (C) 1997-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -44,12 +44,12 @@ void client_disconnect(struct client_task *ct) if (ct->scc.fd >= 0) close(ct->scc.fd); free_argv(ct->features); + ct->features = NULL; sc_free(ct->scc.recv); ct->scc.recv = NULL; sc_free(ct->scc.send); ct->scc.send = NULL; - btr_free_node(ct->btrn); - ct->btrn = NULL; + btr_remove_node(&ct->btrn); } /** @@ -334,7 +334,9 @@ static void client_post_select(struct sched *s, struct task *t) size_t n; char buf[CLIENT_BUFSIZE]; - t->error = 0; + ret = task_get_notification(t); + if (ret < 0) + goto out; if (ct->scc.fd < 0) return; switch (ct->status) { @@ -343,6 +345,11 @@ static void client_post_select(struct sched *s, struct task *t) if (ret < 0 || n == 0) goto out; ct->features = parse_features(buf); + if (!has_feature("sideband", ct)) { + PARA_ERROR_LOG("server has no sideband support\n"); + ret = -E_INCOMPAT_FEAT; + goto out; + } ct->status = CL_RECEIVED_WELCOME; return; case CL_RECEIVED_WELCOME: /* send auth command */ @@ -562,7 +569,7 @@ out: if (!ct->use_sideband && ret != -E_SERVER_EOF && ret != -E_BTR_EOF && ret != -E_EOF) PARA_ERROR_LOG("%s\n", para_strerror(-t->error)); - btr_remove_node(btrn); + btr_remove_node(&ct->btrn); } }