client: Remove client_recv_buffer().
[paraslash.git] / client_common.c
index cee76f8b9449d8b9bcd1b9af1db83ec7bdf03354..38e596e3f7f84b4d780ee0da80b08957fd0754ff 100644 (file)
@@ -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);