Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
httpc: fix the error -22 for embedded RTP data (SAT>IP client)
  • Loading branch information
perexg committed Oct 9, 2015
1 parent e79ea98 commit 935f983
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/httpc.c
Expand Up @@ -671,7 +671,8 @@ http_client_finish( http_client_t *hc )
return HTTP_CON_RECEIVING;
}
}
if (TAILQ_FIRST(&hc->hc_wqueue) && hc->hc_code == HTTP_STATUS_OK) {
if (TAILQ_FIRST(&hc->hc_wqueue) && hc->hc_code == HTTP_STATUS_OK &&
!hc->hc_in_rtp_data) {
hc->hc_code = 0;
return http_client_send_partial(hc);
}
Expand Down Expand Up @@ -972,7 +973,9 @@ http_client_run( http_client_t *hc )
p = strtok_r(hc->hc_rbuf, "\r\n", &saveptr);
if (p == NULL)
return http_client_flush(hc, -EINVAL);
tvhtrace("httpc", "%04X: %s answer '%s'", shortid(hc), http_ver2str(hc->hc_version), p);
tvhtrace("httpc", "%04X: %s answer '%s' (rcseq: %d)",
shortid(hc), http_ver2str(hc->hc_version), p, hc->hc_rcseq);
tvhlog_hexdump("httpc", hc->hc_rbuf, hc->hc_hsize);
if (http_tokenize(p, argv, 3, -1) != 3)
return http_client_flush(hc, -EINVAL);
if ((ver = http_str2ver(argv[0])) < 0)
Expand All @@ -991,7 +994,6 @@ http_client_run( http_client_t *hc )
if (res < 0)
return http_client_flush(hc, -EINVAL);
}
tvhtrace("httpc", "header parse1");
p = http_arg_get(&hc->hc_args, "Content-Length");
if (p) {
hc->hc_csize = atoll(p);
Expand Down Expand Up @@ -1071,6 +1073,7 @@ http_client_run( http_client_t *hc )
if (res < 0)
return http_client_flush(hc, res);
hc->hc_in_rtp_data = 1;
hc->hc_code = 0;
res = http_client_finish(hc);
hc->hc_in_rtp_data = 0;
if (res < 0)
Expand Down

0 comments on commit 935f983

Please sign in to comment.