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
48f0c21d
Commit
48f0c21d
authored
Jan 05, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: revector initial response header handling
parent
69f16e15
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
14 deletions
+24
-14
modules/access/http/connmgr.c
modules/access/http/connmgr.c
+1
-2
modules/access/http/file_test.c
modules/access/http/file_test.c
+1
-1
modules/access/http/h1conn_test.c
modules/access/http/h1conn_test.c
+6
-5
modules/access/http/h2conn_test.c
modules/access/http/h2conn_test.c
+6
-6
modules/access/http/message.c
modules/access/http/message.c
+8
-0
modules/access/http/message.h
modules/access/http/message.h
+2
-0
No files found.
modules/access/http/connmgr.c
View file @
48f0c21d
...
...
@@ -167,11 +167,10 @@ struct vlc_http_msg *vlc_http_mgr_reuse(struct vlc_http_mgr *mgr,
struct
vlc_http_stream
*
stream
=
vlc_http_stream_open
(
conn
,
req
);
if
(
stream
!=
NULL
)
{
struct
vlc_http_msg
*
m
=
vlc_http_
stream_read_headers
(
stream
);
struct
vlc_http_msg
*
m
=
vlc_http_
msg_get_initial
(
stream
);
if
(
m
!=
NULL
)
return
m
;
vlc_http_stream_close
(
stream
,
false
);
/* NOTE: If the request were not idempotent, we would not know if it
* was processed by the other end. Thus POST is not used/supported so
* far, and CONNECT is treated as if it were idempotent (which works
...
...
modules/access/http/file_test.c
View file @
48f0c21d
...
...
@@ -323,7 +323,7 @@ struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
assert
(
mtime
==
1382386402
);
}
return
vlc_http_
stream_read_headers
(
&
stream
);
return
vlc_http_
msg_get_initial
(
&
stream
);
}
int
vlc_http_mgr_send_cookies
(
struct
vlc_http_mgr
*
mgr
,
...
...
modules/access/http/h1conn_test.c
View file @
48f0c21d
...
...
@@ -124,7 +124,8 @@ int main(void)
assert
(
m
==
NULL
);
b
=
vlc_http_stream_read
(
s
);
assert
(
b
==
NULL
);
vlc_http_stream_close
(
s
,
true
);
m
=
vlc_http_msg_get_initial
(
s
);
assert
(
m
==
NULL
);
s
=
stream_open
();
assert
(
s
==
NULL
);
...
...
@@ -149,7 +150,7 @@ int main(void)
s
=
stream_open
();
assert
(
s
!=
NULL
);
conn_send
(
"HTTP/1.0 200 OK
\r\n\r\n
"
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
conn_send
(
"Hello world!"
);
...
...
@@ -169,7 +170,7 @@ int main(void)
s
=
stream_open
();
assert
(
s
!=
NULL
);
conn_send
(
"HTTP/1.1 200 OK
\r\n
Connection: close
\r\n\r\n
"
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
conn_send
(
"Hello again!"
);
...
...
@@ -190,7 +191,7 @@ int main(void)
assert
(
s
!=
NULL
);
conn_send
(
"HTTP/1.1 200 OK
\r\n
Transfer-Encoding: chunked
\r\n
"
"Content-Length: 1000000
\r\n\r\n
"
);
/* length must be ignored */
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
conn_send
(
"C
\r\n
Hello there!
\r\n
0
\r\n\r\n
"
);
...
...
@@ -209,7 +210,7 @@ int main(void)
s
=
stream_open
();
assert
(
s
!=
NULL
);
conn_send
(
"HTTP/1.1 200 OK
\r\n
Content-Length: 8
\r\n\r\n
"
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
conn_send
(
"Bye bye!"
);
...
...
modules/access/http/h2conn_test.c
View file @
48f0c21d
...
...
@@ -188,7 +188,7 @@ int main(void)
s
=
stream_open
();
assert
(
s
!=
NULL
);
stream_reply
(
sid
,
false
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
vlc_http_msg_destroy
(
m
);
...
...
@@ -205,7 +205,7 @@ int main(void)
s
=
stream_open
();
assert
(
s
!=
NULL
);
stream_continuation
(
sid
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
assert
(
vlc_http_msg_get_status
(
m
)
==
100
);
stream_reply
(
sid
,
false
);
...
...
@@ -238,10 +238,10 @@ int main(void)
s2
=
stream_open
();
/* second stream to enforce test timing/ordering */
assert
(
s2
!=
NULL
);
stream_reply
(
sid
,
true
);
m
=
vlc_http_
stream_read_headers
(
s2
);
m
=
vlc_http_
msg_get_initial
(
s2
);
assert
(
m
!=
NULL
);
vlc_http_msg_destroy
(
m
);
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
assert
(
vlc_http_msg_get_status
(
m
)
==
200
);
b
=
vlc_http_msg_read
(
m
);
...
...
@@ -266,10 +266,10 @@ int main(void)
stream_reply
(
sid
,
false
);
stream_reply
(
sid
-
2
,
true
);
stream_data
(
sid
,
"Discarded"
,
false
);
/* not read data */
m
=
vlc_http_
stream_read_headers
(
s
);
m
=
vlc_http_
msg_get_initial
(
s
);
assert
(
m
!=
NULL
);
vlc_http_msg_destroy
(
m
);
m
=
vlc_http_
stream_read_headers
(
s2
);
m
=
vlc_http_
msg_get_initial
(
s2
);
assert
(
m
!=
NULL
);
vlc_http_msg_destroy
(
m
);
...
...
modules/access/http/message.c
View file @
48f0c21d
...
...
@@ -262,6 +262,14 @@ struct vlc_http_msg *vlc_http_msg_iterate(struct vlc_http_msg *m)
return
next
;
}
struct
vlc_http_msg
*
vlc_http_msg_get_initial
(
struct
vlc_http_stream
*
s
)
{
struct
vlc_http_msg
*
m
=
vlc_http_stream_read_headers
(
s
);
if
(
m
==
NULL
)
vlc_http_stream_close
(
s
,
false
);
return
m
;
}
struct
vlc_http_msg
*
vlc_http_msg_get_final
(
struct
vlc_http_msg
*
m
)
{
while
(
m
!=
NULL
&&
(
vlc_http_msg_get_status
(
m
)
/
100
)
==
1
)
...
...
modules/access/http/message.h
View file @
48f0c21d
...
...
@@ -221,6 +221,8 @@ struct block_t *vlc_http_msg_read(struct vlc_http_msg *m) VLC_USED;
struct
vlc_http_stream
;
void
vlc_http_msg_attach
(
struct
vlc_http_msg
*
m
,
struct
vlc_http_stream
*
s
);
struct
vlc_http_msg
*
vlc_http_msg_get_initial
(
struct
vlc_http_stream
*
s
)
VLC_USED
;
struct
vlc_http_stream_cbs
{
...
...
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