Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
4522316a
Commit
4522316a
authored
Jan 07, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: revector cookie handling
parent
a79cc76f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
32 deletions
+14
-32
modules/access/http/connmgr.c
modules/access/http/connmgr.c
+2
-11
modules/access/http/connmgr.h
modules/access/http/connmgr.h
+1
-4
modules/access/http/file_test.c
modules/access/http/file_test.c
+2
-14
modules/access/http/message.c
modules/access/http/message.c
+6
-0
modules/access/http/resource.c
modules/access/http/resource.c
+3
-3
No files found.
modules/access/http/connmgr.c
View file @
4522316a
...
...
@@ -299,18 +299,9 @@ struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
return
(
https
?
vlc_https_request
:
vlc_http_request
)(
mgr
,
host
,
port
,
m
);
}
int
vlc_http_mgr_send_cookies
(
struct
vlc_http_mgr
*
mgr
,
struct
vlc_http_msg
*
req
)
struct
vlc_http_cookie_jar_t
*
vlc_http_mgr_get_jar
(
struct
vlc_http_mgr
*
mgr
)
{
return
mgr
->
jar
!=
NULL
?
vlc_http_msg_add_cookies
(
req
,
mgr
->
jar
)
:
0
;
}
void
vlc_http_mgr_recv_cookies
(
struct
vlc_http_mgr
*
mgr
,
bool
https
,
const
char
*
host
,
const
char
*
path
,
const
struct
vlc_http_msg
*
resp
)
{
if
(
mgr
->
jar
!=
NULL
)
vlc_http_msg_get_cookies
(
resp
,
mgr
->
jar
,
https
,
host
,
path
);
return
mgr
->
jar
;
}
struct
vlc_http_mgr
*
vlc_http_mgr_create
(
vlc_object_t
*
obj
,
...
...
modules/access/http/connmgr.h
View file @
4522316a
...
...
@@ -51,10 +51,7 @@ struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
const
char
*
host
,
unsigned
port
,
const
struct
vlc_http_msg
*
req
);
int
vlc_http_mgr_send_cookies
(
struct
vlc_http_mgr
*
,
struct
vlc_http_msg
*
);
void
vlc_http_mgr_recv_cookies
(
struct
vlc_http_mgr
*
mgr
,
bool
https
,
const
char
*
host
,
const
char
*
path
,
const
struct
vlc_http_msg
*
resp
);
struct
vlc_http_cookie_jar_t
*
vlc_http_mgr_get_jar
(
struct
vlc_http_mgr
*
);
/**
* Creates an HTTP connection manager
...
...
modules/access/http/file_test.c
View file @
4522316a
...
...
@@ -326,20 +326,8 @@ struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
return
vlc_http_msg_get_initial
(
&
stream
);
}
int
vlc_http_mgr_send_cookies
(
struct
vlc_http_mgr
*
mgr
,
struct
vlc_http_msg
*
req
)
struct
vlc_http_cookie_jar_t
*
vlc_http_mgr_get_jar
(
struct
vlc_http_mgr
*
mgr
)
{
assert
(
mgr
==
NULL
);
return
vlc_http_msg_add_cookies
(
req
,
jar
);
}
void
vlc_http_mgr_recv_cookies
(
struct
vlc_http_mgr
*
mgr
,
bool
https
,
const
char
*
host
,
const
char
*
path
,
const
struct
vlc_http_msg
*
resp
)
{
assert
(
mgr
==
NULL
);
assert
(
https
);
assert
(
!
strcmp
(
host
,
"www.example.com"
));
assert
(
!
strcmp
(
path
,
"/dir/file.ext?a=b"
));
vlc_http_msg_get_cookies
(
resp
,
jar
,
https
,
host
,
path
);
return
jar
;
}
modules/access/http/message.c
View file @
4522316a
...
...
@@ -853,6 +853,9 @@ void vlc_http_msg_get_cookies(const struct vlc_http_msg *m,
vlc_http_cookie_jar_t
*
jar
,
bool
secure
,
const
char
*
host
,
const
char
*
path
)
{
if
(
jar
==
NULL
)
return
;
for
(
unsigned
i
=
0
;
i
<
m
->
count
;
i
++
)
if
(
!
strcasecmp
(
m
->
headers
[
i
][
0
],
"Set-Cookie"
))
vlc_http_cookies_store
(
jar
,
m
->
headers
[
i
][
1
],
secure
,
host
,
path
);
...
...
@@ -878,6 +881,9 @@ int vlc_http_msg_add_cookies(struct vlc_http_msg *m,
else
return
0
;
if
(
jar
==
NULL
)
return
0
;
if
(
m
->
authority
[
0
]
==
'['
)
host
=
strndup
(
m
->
authority
+
1
,
strcspn
(
m
->
authority
+
1
,
"]"
));
else
...
...
modules/access/http/resource.c
View file @
4522316a
...
...
@@ -64,7 +64,7 @@ vlc_http_res_req(const struct vlc_http_resource *res)
if
(
res
->
referrer
!=
NULL
)
/* TODO: validate URL */
vlc_http_msg_add_header
(
req
,
"Referer"
,
"%s"
,
res
->
referrer
);
vlc_http_m
gr_send_cookies
(
res
->
manager
,
req
);
vlc_http_m
sg_add_cookies
(
req
,
vlc_http_mgr_get_jar
(
res
->
manager
)
);
/* TODO: vlc_http_msg_add_header(req, "TE", "gzip, deflate"); */
...
...
@@ -93,8 +93,8 @@ struct vlc_http_msg *vlc_http_res_open(struct vlc_http_resource *res,
if
(
resp
==
NULL
)
return
NULL
;
vlc_http_m
gr_recv_cookies
(
res
->
manager
,
res
->
secure
,
res
->
host
,
res
->
path
,
resp
);
vlc_http_m
sg_get_cookies
(
resp
,
vlc_http_mgr_get_jar
(
res
->
manager
)
,
res
->
secure
,
res
->
host
,
res
->
path
);
int
status
=
vlc_http_msg_get_status
(
resp
);
if
(
status
<
200
||
status
>=
599
)
...
...
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