vtl: re-request frame on 503/try-again
This commit is contained in:
parent
88bf5eceea
commit
e1f3dcee2a
@ -194,7 +194,14 @@ http_get_thread (void *arg) {
|
|||||||
(long int) vif->get_req_frame(), vif->get_width(), vif->get_height(),
|
(long int) vif->get_req_frame(), vif->get_width(), vif->get_height(),
|
||||||
vif->get_video_filename().c_str()
|
vif->get_video_filename().c_str()
|
||||||
);
|
);
|
||||||
char *res=curl_http_get(url, NULL);
|
int status = 0;
|
||||||
|
int timeout = 400; // * 5ms -> 2sec
|
||||||
|
char *res = NULL;
|
||||||
|
do {
|
||||||
|
res=curl_http_get(url, &status);
|
||||||
|
if (status == 503) usleep(5000); // try-again
|
||||||
|
} while (status == 503 && --timeout > 0);
|
||||||
|
|
||||||
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