Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
7d5a519f
Commit
7d5a519f
authored
Oct 20, 2023
by
Dridi Boukelmoune
Committed by
Simon Stridsberg
Mar 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vtc_http2: Automatic stream identifier
parent
48c299c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
a02028.vtc
bin/varnishtest/tests/a02028.vtc
+24
-0
vtc_http.h
bin/varnishtest/vtc_http.h
+1
-0
vtc_http2.c
bin/varnishtest/vtc_http2.c
+13
-3
No files found.
bin/varnishtest/tests/a02028.vtc
0 → 100644
View file @
7d5a519f
varnishtest "Automatic stream numbers"
server s1 {
loop 4 {
stream next {
rxreq
txresp
} -run
}
} -start
client c1 -connect ${s1_sock} {
loop 3 {
stream next {
txreq
rxresp
} -run
}
stream 7 {
txreq
rxresp
} -run
} -run
bin/varnishtest/vtc_http.h
View file @
7d5a519f
...
...
@@ -86,6 +86,7 @@ struct http {
pthread_t
tp
;
VTAILQ_HEAD
(,
stream
)
streams
;
unsigned
last_stream
;
pthread_mutex_t
mtx
;
pthread_cond_t
cond
;
struct
hpk_ctx
*
encctx
;
...
...
bin/varnishtest/vtc_http2.c
View file @
7d5a519f
...
...
@@ -2639,9 +2639,17 @@ stream_thread(void *priv)
static
struct
stream
*
stream_new
(
const
char
*
name
,
struct
http
*
h
)
{
char
*
p
;
char
*
p
,
buf
[
20
]
;
struct
stream
*
s
;
if
(
!
strcmp
(
"next"
,
name
))
{
if
(
h
->
last_stream
>
0
)
bprintf
(
buf
,
"%d"
,
h
->
last_stream
+
2
);
else
bprintf
(
buf
,
"%d"
,
1
);
name
=
buf
;
}
ALLOC_OBJ
(
s
,
STREAM_MAGIC
);
AN
(
s
);
AZ
(
pthread_cond_init
(
&
s
->
cond
,
NULL
));
...
...
@@ -2663,6 +2671,7 @@ stream_new(const char *name, struct http *h)
CHECK_OBJ_NOTNULL
(
h
,
HTTP_MAGIC
);
s
->
hp
=
h
;
h
->
last_stream
=
s
->
id
;
//bprintf(s->connect, "%s", "${v1_sock}");
AZ
(
pthread_mutex_lock
(
&
h
->
mtx
));
...
...
@@ -2768,7 +2777,8 @@ stream_run(struct stream *s)
* stream ID [SPEC] [ACTION]
*
* ID is the HTTP/2 stream number, while SPEC describes what will be
* done in that stream.
* done in that stream. If ID has the value ``next``, the actual stream
* number is computed based on the last one.
*
* Note that, when parsing a stream action, if the entity isn't operating
* in HTTP/2 mode, these spec is ran before::
...
...
@@ -2837,7 +2847,7 @@ cmd_stream(CMD_ARGS)
continue
;
}
if
(
**
av
==
'-'
)
vtc_fatal
(
vl
,
"Unknown
client
argument: %s"
,
*
av
);
vtc_fatal
(
vl
,
"Unknown
stream
argument: %s"
,
*
av
);
REPLACE
(
s
->
spec
,
*
av
);
}
}
...
...
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