Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Libraries
nghttp2
Commits
e302cc9c
Commit
e302cc9c
authored
Mar 04, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Simplify function parameter using StringRef
parent
3f2b54cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
18 deletions
+10
-18
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+3
-5
src/shrpx_http2_upstream.h
src/shrpx_http2_upstream.h
+1
-2
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+1
-2
src/shrpx_https_upstream.h
src/shrpx_https_upstream.h
+1
-2
src/shrpx_mruby_module_request.cc
src/shrpx_mruby_module_request.cc
+1
-1
src/shrpx_spdy_upstream.cc
src/shrpx_spdy_upstream.cc
+1
-2
src/shrpx_spdy_upstream.h
src/shrpx_spdy_upstream.h
+1
-2
src/shrpx_upstream.h
src/shrpx_upstream.h
+1
-2
No files found.
src/shrpx_http2_upstream.cc
View file @
e302cc9c
...
...
@@ -1848,11 +1848,10 @@ bool Http2Upstream::push_enabled() const {
get_config
()
->
http2_proxy
);
}
int
Http2Upstream
::
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
)
{
int
Http2Upstream
::
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
)
{
int
rv
;
if
(
len
==
0
||
!
push_enabled
()
||
(
downstream
->
get_stream_id
()
%
2
))
{
if
(
uri
.
empty
()
||
!
push_enabled
()
||
(
downstream
->
get_stream_id
()
%
2
))
{
return
0
;
}
...
...
@@ -1866,8 +1865,7 @@ int Http2Upstream::initiate_push(Downstream *downstream, const char *uri,
const
std
::
string
*
scheme_ptr
,
*
authority_ptr
;
std
::
string
scheme
,
authority
,
path
;
rv
=
http2
::
construct_push_component
(
scheme
,
authority
,
path
,
base
,
StringRef
{
uri
,
len
});
rv
=
http2
::
construct_push_component
(
scheme
,
authority
,
path
,
base
,
uri
);
if
(
rv
!=
0
)
{
return
-
1
;
}
...
...
src/shrpx_http2_upstream.h
View file @
e302cc9c
...
...
@@ -81,8 +81,7 @@ public:
virtual
int
on_downstream_reset
(
bool
no_retry
);
virtual
int
send_reply
(
Downstream
*
downstream
,
const
uint8_t
*
body
,
size_t
bodylen
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
);
virtual
int
response_riovec
(
struct
iovec
*
iov
,
int
iovcnt
)
const
;
virtual
void
response_drain
(
size_t
n
);
virtual
bool
response_empty
()
const
;
...
...
src/shrpx_https_upstream.cc
View file @
e302cc9c
...
...
@@ -1153,8 +1153,7 @@ fail:
return
0
;
}
int
HttpsUpstream
::
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
)
{
int
HttpsUpstream
::
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
)
{
return
0
;
}
...
...
src/shrpx_https_upstream.h
View file @
e302cc9c
...
...
@@ -76,8 +76,7 @@ public:
virtual
int
on_downstream_reset
(
bool
no_retry
);
virtual
int
send_reply
(
Downstream
*
downstream
,
const
uint8_t
*
body
,
size_t
bodylen
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
);
virtual
int
response_riovec
(
struct
iovec
*
iov
,
int
iovcnt
)
const
;
virtual
void
response_drain
(
size_t
n
);
virtual
bool
response_empty
()
const
;
...
...
src/shrpx_mruby_module_request.cc
View file @
e302cc9c
...
...
@@ -291,7 +291,7 @@ mrb_value request_push(mrb_state *mrb, mrb_value self) {
mrb_int
len
;
mrb_get_args
(
mrb
,
"s"
,
&
uri
,
&
len
);
upstream
->
initiate_push
(
downstream
,
uri
,
len
);
upstream
->
initiate_push
(
downstream
,
StringRef
{
uri
,
static_cast
<
size_t
>
(
len
)}
);
return
mrb_nil_value
();
}
...
...
src/shrpx_spdy_upstream.cc
View file @
e302cc9c
...
...
@@ -1252,8 +1252,7 @@ int SpdyUpstream::on_downstream_reset(bool no_retry) {
return
0
;
}
int
SpdyUpstream
::
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
)
{
int
SpdyUpstream
::
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
)
{
return
0
;
}
...
...
src/shrpx_spdy_upstream.h
View file @
e302cc9c
...
...
@@ -76,8 +76,7 @@ public:
virtual
int
send_reply
(
Downstream
*
downstream
,
const
uint8_t
*
body
,
size_t
bodylen
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
);
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
);
virtual
int
response_riovec
(
struct
iovec
*
iov
,
int
iovcnt
)
const
;
virtual
void
response_drain
(
size_t
n
);
virtual
bool
response_empty
()
const
;
...
...
src/shrpx_upstream.h
View file @
e302cc9c
...
...
@@ -68,8 +68,7 @@ public:
virtual
int
send_reply
(
Downstream
*
downstream
,
const
uint8_t
*
body
,
size_t
bodylen
)
=
0
;
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
char
*
uri
,
size_t
len
)
=
0
;
virtual
int
initiate_push
(
Downstream
*
downstream
,
const
StringRef
&
uri
)
=
0
;
// Fills response data in |iov| whose capacity is |iovcnt|. Returns
// the number of iovs filled.
...
...
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