Commit 86502818 authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont

http: don't try to re-open connection if it previously failed

Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 2ff28cdd
......@@ -44,6 +44,7 @@ struct vlc_http_file
struct vlc_http_resource resource;
struct vlc_http_msg *resp;
uintmax_t offset;
bool failed;
};
static int vlc_http_file_req(struct vlc_http_msg *req,
......@@ -132,6 +133,7 @@ struct vlc_http_file *vlc_http_file_create(struct vlc_http_mgr *mgr,
file->resp = NULL;
file->offset = 0;
file->failed = false;
return file;
}
......@@ -139,9 +141,14 @@ int vlc_http_file_get_status(struct vlc_http_file *file)
{
if (file->resp == NULL)
{
if (file->failed)
return -1;
file->resp = vlc_http_file_open(file, file->offset);
if (file->resp == NULL)
{
file->failed = true;
return -1;
}
}
return vlc_http_msg_get_status(file->resp);
}
......
......@@ -35,6 +35,7 @@ struct vlc_http_live
{
struct vlc_http_resource resource;
struct vlc_http_msg *resp;
bool failed;
};
static int vlc_http_live_req(struct vlc_http_msg *req,
......@@ -74,6 +75,7 @@ struct vlc_http_live *vlc_http_live_create(struct vlc_http_mgr *mgr,
}
live->resp = NULL;
live->failed = false;
return live;
}
......@@ -81,9 +83,14 @@ int vlc_http_live_get_status(struct vlc_http_live *live)
{
if (live->resp == NULL)
{
if (live->failed)
return -1;
live->resp = vlc_http_live_open(live);
if (live->resp == NULL)
{
live->failed = true;
return -1;
}
}
return vlc_http_msg_get_status(live->resp);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment