Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
59525641
Commit
59525641
authored
Jun 01, 2012
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: Simplify code by removing a local variable
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
3cbcfa2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
http.c
libavformat/http.c
+9
-12
No files found.
libavformat/http.c
View file @
59525641
...
...
@@ -103,7 +103,6 @@ static int http_open_cnx(URLContext *h)
int
port
,
use_proxy
,
err
,
location_changed
=
0
,
redirects
=
0
,
attempts
=
0
;
HTTPAuthType
cur_auth_type
,
cur_proxy_auth_type
;
HTTPContext
*
s
=
h
->
priv_data
;
URLContext
*
hd
=
NULL
;
proxy_path
=
getenv
(
"http_proxy"
);
use_proxy
=
(
proxy_path
!=
NULL
)
&&
!
getenv
(
"no_proxy"
)
&&
...
...
@@ -144,12 +143,10 @@ static int http_open_cnx(URLContext *h)
ff_url_join
(
buf
,
sizeof
(
buf
),
lower_proto
,
NULL
,
hostname
,
port
,
NULL
);
if
(
!
s
->
hd
)
{
err
=
ffurl_open
(
&
hd
,
buf
,
AVIO_FLAG_READ_WRITE
,
err
=
ffurl_open
(
&
s
->
hd
,
buf
,
AVIO_FLAG_READ_WRITE
,
&
h
->
interrupt_callback
,
NULL
);
if
(
err
<
0
)
goto
fail
;
s
->
hd
=
hd
;
}
cur_auth_type
=
s
->
auth_state
.
auth_type
;
...
...
@@ -160,8 +157,8 @@ static int http_open_cnx(URLContext *h)
if
(
s
->
http_code
==
401
)
{
if
((
cur_auth_type
==
HTTP_AUTH_NONE
||
s
->
auth_state
.
stale
)
&&
s
->
auth_state
.
auth_type
!=
HTTP_AUTH_NONE
&&
attempts
<
4
)
{
ffurl_close
(
hd
);
s
->
hd
=
hd
=
NULL
;
ffurl_close
(
s
->
hd
);
s
->
hd
=
NULL
;
goto
redo
;
}
else
goto
fail
;
...
...
@@ -169,8 +166,8 @@ static int http_open_cnx(URLContext *h)
if
(
s
->
http_code
==
407
)
{
if
((
cur_proxy_auth_type
==
HTTP_AUTH_NONE
||
s
->
proxy_auth_state
.
stale
)
&&
s
->
proxy_auth_state
.
auth_type
!=
HTTP_AUTH_NONE
&&
attempts
<
4
)
{
ffurl_close
(
hd
);
s
->
hd
=
hd
=
NULL
;
ffurl_close
(
s
->
hd
);
s
->
hd
=
NULL
;
goto
redo
;
}
else
goto
fail
;
...
...
@@ -178,8 +175,8 @@ static int http_open_cnx(URLContext *h)
if
((
s
->
http_code
==
301
||
s
->
http_code
==
302
||
s
->
http_code
==
303
||
s
->
http_code
==
307
)
&&
location_changed
==
1
)
{
/* url moved, get next */
ffurl_close
(
hd
);
s
->
hd
=
hd
=
NULL
;
ffurl_close
(
s
->
hd
);
s
->
hd
=
NULL
;
if
(
redirects
++
>=
MAX_REDIRECTS
)
return
AVERROR
(
EIO
);
/* Restart the authentication process with the new target, which
...
...
@@ -191,8 +188,8 @@ static int http_open_cnx(URLContext *h)
}
return
0
;
fail:
if
(
hd
)
ffurl_close
(
hd
);
if
(
s
->
hd
)
ffurl_close
(
s
->
hd
);
s
->
hd
=
NULL
;
return
AVERROR
(
EIO
);
}
...
...
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