From: Andre Noll Date: Wed, 21 Mar 2018 12:56:04 +0000 (+0100) Subject: http_recv: Improve error diagnostics. X-Git-Tag: v0.6.2~21 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=790c87f7e93aba21ffcfea996029ee80c4ccf9ac http_recv: Improve error diagnostics. If the http receiver is started when the stream is stopped or paused, para_recv exits silently with no error message. Let's tell the user what is going on. --- diff --git a/http_recv.c b/http_recv.c index c581ebdd..3a723299 100644 --- a/http_recv.c +++ b/http_recv.c @@ -106,8 +106,10 @@ static int http_recv_post_select(struct sched *s, void *context) } if (phd->status == HTTP_SENT_GET_REQUEST) { ret = read_pattern(rn->fd, HTTP_OK_MSG, strlen(HTTP_OK_MSG), &s->rfds); - if (ret < 0) + if (ret < 0) { + PARA_ERROR_LOG("did not receive HTTP OK message\n"); goto out; + } if (ret == 0) return 0; PARA_INFO_LOG("received ok msg, streaming\n"); @@ -128,8 +130,10 @@ static int http_recv_post_select(struct sched *s, void *context) btr_add_output_pool(rn->btrp, num_bytes - iov[0].iov_len, btrn); } out: - if (ret < 0) + if (ret < 0) { + PARA_NOTICE_LOG("%s\n", para_strerror(-ret)); btr_remove_node(&rn->btrn); + } return ret; }