X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client_common.c;h=54bb9433e34cbd0a5bbfed50d07a7d536e0f8b65;hp=593cb2c044c37995d76fa58f4abcb0a6ab198668;hb=be9f7c9b442f7b723427a79f85774d5fa7718425;hpb=9b565c60fd159e12d255bb18db9dbff066deebea diff --git a/client_common.c b/client_common.c index 593cb2c0..54bb9433 100644 --- a/client_common.c +++ b/client_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2010 Andre Noll + * Copyright (C) 1997-2011 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -25,6 +25,7 @@ #include "client.h" #include "hash.h" #include "buffer_tree.h" +#include "version.h" /** The size of the receiving buffer. */ #define CLIENT_BUFSIZE 4000 @@ -170,7 +171,7 @@ static void client_post_select(struct sched *s, struct task *t) return; ret = send_buffer(ct->rc4c.fd, buf); if (ret < 0) - goto err; + goto out; ct->status = CL_SENT_AUTH; return; case CL_SENT_AUTH: @@ -191,7 +192,7 @@ static void client_post_select(struct sched *s, struct task *t) ret = para_decrypt_buffer(ct->key_file, crypt_buf, (unsigned char *)buf, n); if (ret < 0) - goto err; + goto out; sha1_hash((char *)crypt_buf, CHALLENGE_SIZE, challenge_sha1); RC4_set_key(&ct->rc4c.send_key, RC4_KEY_LEN, crypt_buf + CHALLENGE_SIZE); @@ -202,7 +203,7 @@ static void client_post_select(struct sched *s, struct task *t) ret = send_bin_buffer(ct->rc4c.fd, (char *)challenge_sha1, HASH_SIZE); if (ret < 0) - goto err; + goto out; ct->status = CL_SENT_CH_RESPONSE; return; } @@ -237,7 +238,7 @@ static void client_post_select(struct sched *s, struct task *t) ret = rc4_send_buffer(&ct->rc4c, command); free(command); if (ret < 0) - goto err; + goto out; ct->status = CL_SENT_COMMAND; return; } @@ -265,7 +266,7 @@ static void client_post_select(struct sched *s, struct task *t) size_t sz; ret = btr_node_status(btrn, 0, BTR_NT_LEAF); if (ret < 0) - goto err; + goto out; if (ret == 0) return; if (!FD_ISSET(ct->rc4c.fd, &s->wfds)) @@ -273,7 +274,7 @@ static void client_post_select(struct sched *s, struct task *t) sz = btr_next_buffer(btrn, &buf2); ret = rc4_send_bin_buffer(&ct->rc4c, buf2, sz); if (ret < 0) - goto err; + goto out; btr_consume(btrn, sz); return; } @@ -282,7 +283,7 @@ static void client_post_select(struct sched *s, struct task *t) char *buf2; ret = btr_node_status(btrn, 0, BTR_NT_ROOT); if (ret < 0) - goto err; + goto out; if (ret == 0) return; /* @@ -301,7 +302,6 @@ static void client_post_select(struct sched *s, struct task *t) goto out; } } -err: out: t->error = ret; if (ret < 0) {