- t->ret = recv_pattern(phd->fd, HTTP_OK_MSG, MAXLINE);
- if (t->ret < 0)
- goto out;
- PARA_INFO_LOG("received ok msg, streaming\n");
- t->ret = 1;
- phd->status = HTTP_STREAMING;
- goto out;
+ t->error = recv_pattern(phd->fd, HTTP_OK_MSG, strlen(HTTP_OK_MSG));
+ if (t->error >= 0) {
+ PARA_INFO_LOG("received ok msg, streaming\n");
+ phd->status = HTTP_STREAMING;
+ }
+ return;
+ }
+ if (conf->buffer_tree_given) {
+ char *buf;
+ if (btr_bytes_pending(rn->btrn) > HTTP_RECV_MAX_PENDING) {
+ t->error = -E_HTTP_RECV_OVERRUN;
+ return;
+ }
+ buf = para_malloc(HTTP_RECV_READ_BUF_SIZE);
+ t->error = recv_bin_buffer(phd->fd, buf, HTTP_RECV_READ_BUF_SIZE);
+ if (t->error == 0)
+ t->error = -E_RECV_EOF;
+ if (t->error < 0) {
+ free(buf);
+ return;
+ }
+ btr_add_output(buf, t->error, rn->btrn);
+ return;