]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - http_recv.c
Fix http_recv.
[paraslash.git] / http_recv.c
index b1d3f5f3d7d23924303d79cf60fbd07fd69fc6e9..bedd989ee1f364a751f9e21069f8f2a95c434b94 100644 (file)
@@ -134,7 +134,7 @@ static void http_recv_post_select(struct sched *s, struct task *t)
        }
        if (conf->buffer_tree_given) {
                char *buf;
-               if (btr_bytes_pending(rn->btr_root) > HTTP_RECV_MAX_PENDING) {
+               if (btr_bytes_pending(rn->btrn) > HTTP_RECV_MAX_PENDING) {
                        t->error = -E_HTTP_RECV_OVERRUN;
                        return;
                }
@@ -146,7 +146,7 @@ static void http_recv_post_select(struct sched *s, struct task *t)
                        free(buf);
                        return;
                }
-               btr_add_output(buf, t->error, rn->btr_root);
+               btr_add_output(buf, t->error, rn->btrn);
                return;
        }
        t->error = -E_HTTP_RECV_OVERRUN;
@@ -156,6 +156,9 @@ static void http_recv_post_select(struct sched *s, struct task *t)
                BUFSIZE - rn->loaded);
        if (t->error == 0)
                t->error = -E_RECV_EOF;
+       if (t->error < 0)
+               return;
+       rn->loaded += t->error;
 }
 
 static void http_recv_close(struct receiver_node *rn)