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
49ce44e1
Unverified
Commit
49ce44e1
authored
May 30, 2019
by
Tatsuhiro Tsujikawa
Committed by
GitHub
May 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1352 from nghttp2/travis-osx
Travis osx
parents
f82fb521
f54b3ffc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
8 deletions
+69
-8
.travis.yml
.travis.yml
+22
-5
configure.ac
configure.ac
+1
-1
src/nghttpd.cc
src/nghttpd.cc
+1
-1
src/shrpx.cc
src/shrpx.cc
+1
-1
src/util.cc
src/util.cc
+40
-0
src/util.h
src/util.h
+4
-0
No files found.
.travis.yml
View file @
49ce44e1
dist
:
xenial
dist
:
xenial
os
:
-
linux
compiler
:
-
clang
-
gcc
env
:
env
:
matrix
:
matrix
:
-
CI_BUILD=cmake
-
CI_BUILD=cmake
-
CI_BUILD=autotools
-
CI_BUILD=autotools
matrix
:
include
:
-
os
:
osx
compiler
:
clang
osx_image
:
xcode10.2
env
:
CI_BUILD=autotools
language
:
cpp
language
:
cpp
compiler
:
-
clang
-
gcc
sudo
:
required
sudo
:
required
addons
:
addons
:
apt
:
apt
:
...
@@ -30,6 +38,13 @@ addons:
...
@@ -30,6 +38,13 @@ addons:
-
libc-ares-dev
-
libc-ares-dev
-
cmake
-
cmake
-
cmake-data
-
cmake-data
homebrew
:
packages
:
-
libev
-
libevent
-
c-ares
-
cunit
-
libressl
before_install
:
before_install
:
-
$CC --version
-
$CC --version
-
if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
-
if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
...
@@ -37,13 +52,15 @@ before_install:
...
@@ -37,13 +52,15 @@ before_install:
-
go version
-
go version
-
cmake --version
-
cmake --version
before_script
:
before_script
:
-
if [ "$TRAVIS_OS_NAME" = "linux" ]; then CPPFLAGS=-fsanitize=address LDFLAGS="-fsanitize=address -fuse-ld=gold"; fi
-
if [ "$TRAVIS_OS_NAME" = "osx" ]; then PKG_CONFIG_PATH=/usr/local/opt/libressl/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig; fi
# Now build nghttp2
# Now build nghttp2
-
if [ "$CI_BUILD" = "autotools" ]; then autoreconf -i; fi
-
if [ "$CI_BUILD" = "autotools" ]; then autoreconf -i; fi
-
git submodule update --init
-
git submodule update --init
-
if [ "$CI_BUILD" = "autotools" ]; then ./configure --with-mruby; fi
-
if [ "$CI_BUILD" = "autotools" ]; then ./configure --with-mruby
PKG_CONFIG_PATH=$PKG_CONFIG_PATH
; fi
-
if [ "$CI_BUILD" = "cmake" ]; then cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1; fi
-
if [ "$CI_BUILD" = "cmake" ]; then cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1; fi
script
:
script
:
-
if [ "$CI_BUILD" = "autotools" ]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-neverbleed --enable-werror CPPFLAGS=
-fsanitize=address LDFLAGS=\"-fsanitize=address -fuse-ld=gold\"
"; fi
-
if [ "$CI_BUILD" = "autotools" ]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-neverbleed --enable-werror CPPFLAGS=
$CPPFLAGS LDFLAGS=\"$LDFLAGS\" PKG_CONFIG_PATH=$PKG_CONFIG_PATH
"; fi
-
if [ "$CI_BUILD" = "cmake" ]; then make check; fi
-
if [ "$CI_BUILD" = "cmake" ]; then make check; fi
# As of April, 23, 2016, golang http2 build fails, probably because
# As of April, 23, 2016, golang http2 build fails, probably because
# the default go version is too old.
# the default go version is too old.
...
...
configure.ac
View file @
49ce44e1
...
@@ -899,7 +899,7 @@ AC_MSG_NOTICE([summary of build options:
...
@@ -899,7 +899,7 @@ AC_MSG_NOTICE([summary of build options:
Failmalloc: ${enable_failmalloc}
Failmalloc: ${enable_failmalloc}
Libs:
Libs:
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_C
PP
FLAGS}' LIBS='${LIBXML2_LIBS}')
Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CFLAGS}' LIBS='${LIBXML2_LIBS}')
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
...
...
src/nghttpd.cc
View file @
49ce44e1
...
@@ -435,7 +435,7 @@ int main(int argc, char **argv) {
...
@@ -435,7 +435,7 @@ int main(int argc, char **argv) {
#ifdef __sgi
#ifdef __sgi
if
(
daemon
(
0
,
0
,
0
,
0
)
==
-
1
)
{
if
(
daemon
(
0
,
0
,
0
,
0
)
==
-
1
)
{
#else
#else
if
(
daemon
(
0
,
0
)
==
-
1
)
{
if
(
util
::
daemonize
(
0
,
0
)
==
-
1
)
{
#endif
#endif
perror
(
"daemon"
);
perror
(
"daemon"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
src/shrpx.cc
View file @
49ce44e1
...
@@ -1148,7 +1148,7 @@ int call_daemon() {
...
@@ -1148,7 +1148,7 @@ int call_daemon() {
return
0
;
return
0
;
}
}
# endif // HAVE_LIBSYSTEMD
# endif // HAVE_LIBSYSTEMD
return
daemon
(
0
,
0
);
return
util
::
daemonize
(
0
,
0
);
#endif // !__sgi
#endif // !__sgi
}
}
}
// namespace
}
// namespace
...
...
src/util.cc
View file @
49ce44e1
...
@@ -1542,6 +1542,46 @@ std::mt19937 make_mt19937() {
...
@@ -1542,6 +1542,46 @@ std::mt19937 make_mt19937() {
return
std
::
mt19937
(
rd
());
return
std
::
mt19937
(
rd
());
}
}
int
daemonize
(
int
nochdir
,
int
noclose
)
{
#if defined(__APPLE__)
pid_t
pid
;
pid
=
fork
();
if
(
pid
==
-
1
)
{
return
-
1
;
}
else
if
(
pid
>
0
)
{
_exit
(
EXIT_SUCCESS
);
}
if
(
setsid
()
==
-
1
)
{
return
-
1
;
}
pid
=
fork
();
if
(
pid
==
-
1
)
{
return
-
1
;
}
else
if
(
pid
>
0
)
{
_exit
(
EXIT_SUCCESS
);
}
if
(
nochdir
==
0
)
{
if
(
chdir
(
"/"
)
==
-
1
)
{
return
-
1
;
}
}
if
(
noclose
==
0
)
{
if
(
freopen
(
"/dev/null"
,
"r"
,
stdin
)
==
nullptr
)
{
return
-
1
;
}
if
(
freopen
(
"/dev/null"
,
"w"
,
stdout
)
==
nullptr
)
{
return
-
1
;
}
if
(
freopen
(
"/dev/null"
,
"w"
,
stderr
)
==
nullptr
)
{
return
-
1
;
}
}
return
0
;
#else // !defined(__APPLE__)
return
daemon
(
nochdir
,
noclose
);
#endif // !defined(__APPLE__)
}
}
// namespace util
}
// namespace util
}
// namespace nghttp2
}
// namespace nghttp2
src/util.h
View file @
49ce44e1
...
@@ -772,6 +772,10 @@ StringRef extract_host(const StringRef &hostport);
...
@@ -772,6 +772,10 @@ StringRef extract_host(const StringRef &hostport);
// Returns new std::mt19937 object.
// Returns new std::mt19937 object.
std
::
mt19937
make_mt19937
();
std
::
mt19937
make_mt19937
();
// daemonize calls daemon(3). If __APPLE__ is defined, it implements
// daemon() using fork().
int
daemonize
(
int
nochdir
,
int
noclose
);
}
// namespace util
}
// namespace util
}
// namespace nghttp2
}
// 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