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
6bc7e7bd
Commit
6bc7e7bd
authored
Jul 21, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nghttp client backed by libevent
parent
1dd21c1e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1347 additions
and
6 deletions
+1347
-6
src/Makefile.am
src/Makefile.am
+5
-1
src/nghttp.cc
src/nghttp.cc
+1322
-0
src/spdycat.cc
src/spdycat.cc
+2
-2
src/util.cc
src/util.cc
+3
-3
src/util.h
src/util.h
+15
-0
No files found.
src/Makefile.am
View file @
6bc7e7bd
...
...
@@ -35,7 +35,7 @@ AM_CXXFLAGS = -std=c++11
LDADD
=
$(top_builddir)
/lib/libnghttp2.la
bin_PROGRAMS
+=
spdycat
bin_PROGRAMS
+=
spdycat
nghttp
if
ENABLE_SPDYD
bin_PROGRAMS
+=
spdyd
...
...
@@ -72,6 +72,10 @@ spdycat_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} spdycat.cc \
${HTML_PARSER_OBJECTS}
${HTML_PARSER_HFILES}
\
http-parser/http_parser.c http-parser/http_parser.h
nghttp_SOURCES
=
${HELPER_OBJECTS}
${HELPER_HFILES}
nghttp.cc
\
${HTML_PARSER_OBJECTS}
${HTML_PARSER_HFILES}
\
http-parser/http_parser.c http-parser/http_parser.h
if
ENABLE_SPDYD
SPDY_SERVER_OBJECTS
=
SpdyServer.cc
SPDY_SERVER_HFILES
=
SpdyServer.h
...
...
src/nghttp.cc
0 → 100644
View file @
6bc7e7bd
This diff is collapsed.
Click to expand it.
src/spdycat.cc
View file @
6bc7e7bd
...
...
@@ -486,10 +486,10 @@ void check_response_header
bool
gzip
=
false
;
for
(
size_t
i
=
0
;
i
<
frame
->
headers
.
nvlen
;
++
i
)
{
auto
nv
=
&
frame
->
headers
.
nva
[
i
];
if
(
util
::
strieq
(
"content-encoding"
,
nv
->
name
,
nv
->
namelen
)
==
0
)
{
if
(
util
::
strieq
(
"content-encoding"
,
nv
->
name
,
nv
->
namelen
))
{
gzip
=
util
::
strieq
(
"gzip"
,
nv
->
value
,
nv
->
valuelen
)
||
util
::
strieq
(
"deflate"
,
nv
->
value
,
nv
->
valuelen
);
}
else
if
(
util
::
strieq
(
":status"
,
nv
->
name
,
nv
->
namelen
)
==
0
)
{
}
else
if
(
util
::
strieq
(
":status"
,
nv
->
name
,
nv
->
namelen
))
{
req
->
status
.
assign
(
nv
->
value
,
nv
->
value
+
nv
->
valuelen
);
}
}
...
...
src/util.cc
View file @
6bc7e7bd
...
...
@@ -165,9 +165,9 @@ bool strieq(const char *a, const uint8_t *b, size_t bn)
if
(
!
a
||
!
b
)
{
return
false
;
}
size_t
i
;
for
(
i
=
0
;
i
<
bn
&&
*
a
&&
lowcase
(
*
a
)
==
lowcase
(
*
b
);
++
a
,
++
b
);
return
!*
a
&&
i
==
bn
;
const
uint8_t
*
blast
=
b
+
bn
;
for
(
;
*
a
&&
lowcase
(
*
a
)
==
lowcase
(
*
b
);
++
a
,
++
b
);
return
!*
a
&&
b
==
blast
;
}
bool
strifind
(
const
char
*
a
,
const
char
*
b
)
...
...
src/util.h
View file @
6bc7e7bd
...
...
@@ -32,6 +32,7 @@
#include <string>
#include <algorithm>
#include <sstream>
#include <memory>
namespace
nghttp2
{
...
...
@@ -360,6 +361,20 @@ std::string utos(T n)
return
res
;
}
template
<
typename
T
,
typename
...
U
>
typename
std
::
enable_if
<!
std
::
is_array
<
T
>::
value
,
std
::
unique_ptr
<
T
>>::
type
make_unique
(
U
&&
...
u
)
{
return
std
::
unique_ptr
<
T
>
(
new
T
(
std
::
forward
<
U
>
(
u
)...));
}
template
<
typename
T
>
typename
std
::
enable_if
<
std
::
is_array
<
T
>::
value
,
std
::
unique_ptr
<
T
>>::
type
make_unique
(
size_t
size
)
{
return
std
::
unique_ptr
<
T
>
(
new
typename
std
::
remove_extent
<
T
>::
type
[
size
]());
}
}
// namespace util
}
// namespace nghttp2
...
...
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