Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
e6ede399
Commit
e6ede399
authored
Jan 21, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not store -1 in access_t::info.i_size in http access.
parent
b04d6af6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
modules/access/http.c
modules/access/http.c
+11
-7
No files found.
modules/access/http.c
View file @
e6ede399
...
...
@@ -206,6 +206,7 @@ struct access_sys_t
bool
b_continuous
;
bool
b_pace_control
;
bool
b_persist
;
bool
b_has_size
;
vlc_array_t
*
cookies
;
};
...
...
@@ -307,7 +308,8 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
p_sys
->
psz_icy_title
=
NULL
;
p_sys
->
i_remaining
=
0
;
p_sys
->
b_persist
=
false
;
p_access
->
info
.
i_size
=
-
1
;
p_sys
->
b_has_size
=
false
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
false
;
...
...
@@ -758,7 +760,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
return
0
;
}
if
(
p_
access
->
info
.
i_size
>=
0
&&
if
(
p_
sys
->
b_has_size
&&
i_len
+
p_access
->
info
.
i_pos
>
p_access
->
info
.
i_size
)
{
if
(
(
i_len
=
p_access
->
info
.
i_size
-
p_access
->
info
.
i_pos
)
==
0
)
...
...
@@ -802,7 +804,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
i_len
=
p_sys
->
i_chunk
;
}
}
else
if
(
p_
access
->
info
.
i_size
!=
-
1
&&
(
int64_t
)
i_len
>
p_sys
->
i_remaining
)
{
else
if
(
p_
sys
->
b_has_size
&&
(
int64_t
)
i_len
>
p_sys
->
i_remaining
)
{
/* Only ask for the remaining length */
i_len
=
(
size_t
)
p_sys
->
i_remaining
;
if
(
i_len
==
0
)
{
...
...
@@ -883,7 +885,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
p_access
->
b_error
=
true
;
}
if
(
p_
access
->
info
.
i_size
!=
-
1
)
if
(
p_
sys
->
b_has_size
)
{
p_sys
->
i_remaining
-=
i_read
;
}
...
...
@@ -1129,8 +1131,8 @@ static int Connect( access_t *p_access, int64_t i_tell )
p_sys
->
psz_icy_title
=
NULL
;
p_sys
->
i_remaining
=
0
;
p_sys
->
b_persist
=
false
;
p_access
->
info
.
i_size
=
-
1
;
p_sys
->
b_has_size
=
false
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
i_tell
;
p_access
->
info
.
b_eof
=
false
;
...
...
@@ -1410,6 +1412,7 @@ static int Request( access_t *p_access, int64_t i_tell )
{
int64_t
i_size
=
i_tell
+
(
p_sys
->
i_remaining
=
atoll
(
p
));
if
(
i_size
>
p_access
->
info
.
i_size
)
{
p_sys
->
b_has_size
=
true
;
p_access
->
info
.
i_size
=
i_size
;
}
msg_Dbg
(
p_access
,
"this frame size=%"
PRId64
,
p_sys
->
i_remaining
);
...
...
@@ -1424,6 +1427,7 @@ static int Request( access_t *p_access, int64_t i_tell )
p_sys
->
i_remaining
=
i_nend
+
1
-
i_ntell
;
int64_t
i_size
=
(
i_nsize
>
i_nend
)
?
i_nsize
:
(
i_nend
+
1
);
if
(
i_size
>
p_access
->
info
.
i_size
)
{
p_sys
->
b_has_size
=
true
;
p_access
->
info
.
i_size
=
i_size
;
}
msg_Dbg
(
p_access
,
"stream size=%"
PRId64
",pos=%"
PRId64
",remaining=%"
PRId64
,
i_nsize
,
i_ntell
,
p_sys
->
i_remaining
);
...
...
@@ -1603,7 +1607,7 @@ static int Request( access_t *p_access, int64_t i_tell )
/* We close the stream for zero length data, unless of course the
* server has already promised to do this for us.
*/
if
(
p_
access
->
info
.
i_size
!=
-
1
&&
p_sys
->
i_remaining
==
0
&&
p_sys
->
b_persist
)
{
if
(
p_
sys
->
b_has_size
&&
p_sys
->
i_remaining
==
0
&&
p_sys
->
b_persist
)
{
Disconnect
(
p_access
);
}
return
VLC_SUCCESS
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment