X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client_common.c;h=c738079b6b1f92ab47435bfea9eb6185aa52eef2;hp=8bca7b7f04e237e4bfb0b477b828ae6678f9f2aa;hb=c715d5c6ec226fe172ef3b8a52ccf769b745594b;hpb=4c6dd71312400fc04b3f0582b23a0cff831ee8fa diff --git a/client_common.c b/client_common.c index 8bca7b7f..c738079b 100644 --- a/client_common.c +++ b/client_common.c @@ -50,8 +50,10 @@ void client_close(struct private_client_data *pcd) { if (pcd) return; - if (pcd->fd >= 0) + if (pcd->fd >= 0) { + disable_crypt(pcd->fd); close(pcd->fd); + } free(pcd->user); free(pcd->config_file); free(pcd->key_file); @@ -276,11 +278,8 @@ void client_post_select(struct sched *s, struct task *t) case CL_SENDING: /* FIXME: might block */ PARA_INFO_LOG("loaded: %zd\n", *pcd->in_loaded); t->ret = send_bin_buffer(pcd->fd, pcd->inbuf, *pcd->in_loaded); - if (t->ret <= 0) { - if (!t->ret) - t->ret = 1; + if (t->ret < 0) return; - } *pcd->in_loaded = 0; /* FIXME: short writes */ return; case CL_RECEIVING: