vtl: increase retry timeout on 503, print http status on error.
This commit is contained in:
parent
8d2a6b7687
commit
0781b871d4
|
@ -195,13 +195,17 @@ http_get_thread (void *arg) {
|
||||||
vif->get_video_filename().c_str()
|
vif->get_video_filename().c_str()
|
||||||
);
|
);
|
||||||
int status = 0;
|
int status = 0;
|
||||||
int timeout = 400; // * 5ms -> 2sec
|
int timeout = 1000; // * 5ms -> 5sec
|
||||||
char *res = NULL;
|
char *res = NULL;
|
||||||
do {
|
do {
|
||||||
res=curl_http_get(url, &status);
|
res=curl_http_get(url, &status);
|
||||||
if (status == 503) usleep(5000); // try-again
|
if (status == 503) usleep(5000); // try-again
|
||||||
} while (status == 503 && --timeout > 0);
|
} while (status == 503 && --timeout > 0);
|
||||||
|
|
||||||
|
if (status != 200 || !res) {
|
||||||
|
print("no-video frame: video-server returned http-status: %d\n", status);
|
||||||
|
}
|
||||||
|
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
|
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
|
||||||
vif->http_download_done(res);
|
vif->http_download_done(res);
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user