afs: Use nonblocking API for server commands.
[paraslash.git] / http_recv.c
index cc376dd9a6e0c07c1dfe9f368aebdd1fbaf98c85..636e224158a965ab68c0685c93411fe4767ea991 100644 (file)
@@ -116,12 +116,12 @@ static void http_recv_post_select(struct sched *s, struct task *t)
                phd->status = HTTP_SENT_GET_REQUEST;
                return;
        }
-       if (!FD_ISSET(phd->fd, &s->rfds))
-               return;
        if (phd->status == HTTP_SENT_GET_REQUEST) {
-               ret = recv_pattern(phd->fd, HTTP_OK_MSG, strlen(HTTP_OK_MSG));
+               ret = read_pattern(phd->fd, HTTP_OK_MSG, strlen(HTTP_OK_MSG), &s->rfds);
                if (ret < 0)
                        goto err;
+               if (ret == 0)
+                       return;
                PARA_INFO_LOG("received ok msg, streaming\n");
                phd->status = HTTP_STREAMING;
                return;