X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client_common.c;h=38e596e3f7f84b4d780ee0da80b08957fd0754ff;hp=cee76f8b9449d8b9bcd1b9af1db83ec7bdf03354;hb=243e312286c1dd14cca22e96a9e6882eb95152b0;hpb=277ed4a605f68118aff9e671f16c0ac6edb1d55a diff --git a/client_common.c b/client_common.c index cee76f8b..38e596e3 100644 --- a/client_common.c +++ b/client_common.c @@ -132,31 +132,6 @@ static void client_pre_select(struct sched *s, struct task *t) } } -static int client_recv_buffer(struct client_task *ct, fd_set *rfds, - char *buf, size_t sz, size_t *n) -{ - int ret; - - if (ct->status < CL_SENT_CH_RESPONSE) - return read_nonblock(ct->scc.fd, buf, sz, rfds, n); - - *n = 0; - ret = sc_recv_buffer(&ct->scc, buf, sz); - /* - * sc_recv_buffer is used with blocking fds elsewhere, so it - * does not use the nonblock-API. Therefore we need to - * check for EOF and EAGAIN. - */ - if (ret == 0) - return -E_SERVER_EOF; - if (ret == -ERRNO_TO_PARA_ERROR(EAGAIN)) - return 0; - if (ret < 0) - return ret; - *n = ret; - return 0; -} - static int send_sb(struct client_task *ct, void *buf, size_t numbytes, enum sb_designator band, bool dont_free) { @@ -341,7 +316,7 @@ static void client_post_select(struct sched *s, struct task *t) return; switch (ct->status) { case CL_CONNECTED: /* receive welcome message */ - ret = client_recv_buffer(ct, &s->rfds, buf, sizeof(buf), &n); + ret = read_nonblock(ct->scc.fd, buf, sizeof(buf), &s->rfds, &n); if (ret < 0 || n == 0) goto out; ct->features = parse_features(buf);