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
5fa19386
Commit
5fa19386
authored
Oct 14, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
56ee3d48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
src/memchunk.h
src/memchunk.h
+2
-2
src/util.cc
src/util.cc
+10
-11
No files found.
src/memchunk.h
View file @
5fa19386
...
...
@@ -31,8 +31,8 @@
#ifdef _WIN32
/* Structure for scatter/gather I/O. */
struct
iovec
{
void
*
iov_base
;
/* Pointer to data. */
size_t
iov_len
;
/* Length of data. */
void
*
iov_base
;
/* Pointer to data. */
size_t
iov_len
;
/* Length of data. */
};
#else
#include <sys/uio.h>
...
...
src/util.cc
View file @
5fa19386
...
...
@@ -72,26 +72,24 @@ namespace util {
#ifdef _WIN32
// inet_pton-wrapper for Windows
static
int
inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
static
int
inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
#if _WIN32_WINNT >= 0x0600
return
InetPtonA
(
af
,
src
,
dst
);
return
InetPtonA
(
af
,
src
,
dst
);
#else
// the function takes a 'char*', so we need to make a copy
char
addr
[
INET6_ADDRSTRLEN
+
1
];
strncpy
(
addr
,
src
,
sizeof
(
addr
));
addr
[
sizeof
(
addr
)
-
1
]
=
0
;
addr
[
sizeof
(
addr
)
-
1
]
=
0
;
int
size
=
sizeof
(
struct
in6_addr
);
if
(
WSAStringToAddress
(
addr
,
af
,
NULL
,
(
LPSOCKADDR
)
dst
,
&
size
)
==
0
)
return
1
;
return
1
;
return
0
;
#endif
}
#endif // _WIN32
const
char
UPPER_XDIGITS
[]
=
"0123456789ABCDEF"
;
bool
in_rfc3986_unreserved_chars
(
const
char
c
)
{
...
...
@@ -383,8 +381,9 @@ char *iso8601_date(char *res, int64_t ms) {
namespace
bt
=
boost
::
posix_time
;
// one-time definition of the locale that is used to parse UTC strings
// (note that the time_input_facet is ref-counted and deleted automatically)
static
const
std
::
locale
ptime_locale
(
std
::
locale
::
classic
(),
new
bt
::
time_input_facet
(
"%a, %d %b %Y %H:%M:%S GMT"
));
static
const
std
::
locale
ptime_locale
(
std
::
locale
::
classic
(),
new
bt
::
time_input_facet
(
"%a, %d %b %Y %H:%M:%S GMT"
));
#endif //_WIN32
time_t
parse_http_date
(
const
StringRef
&
s
)
{
...
...
@@ -395,7 +394,7 @@ time_t parse_http_date(const StringRef &s) {
bt
::
ptime
ltime
;
sstr
>>
ltime
;
if
(
!
sstr
)
return
0
;
return
0
;
return
boost
::
posix_time
::
to_time_t
(
ltime
);
#else
...
...
@@ -936,7 +935,7 @@ int create_nonblock_socket(int family) {
bool
check_socket_connected
(
int
fd
)
{
int
error
;
socklen_t
len
=
sizeof
(
error
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
error
,
&
len
)
!=
0
)
{
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
error
,
&
len
)
!=
0
)
{
return
false
;
}
...
...
@@ -946,7 +945,7 @@ bool check_socket_connected(int fd) {
int
get_socket_error
(
int
fd
)
{
int
error
;
socklen_t
len
=
sizeof
(
error
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
error
,
&
len
)
!=
0
)
{
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
error
,
&
len
)
!=
0
)
{
return
-
1
;
}
...
...
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