Commit 810c2202 authored by kapishnikov's avatar kapishnikov Committed by Commit bot

[third-party] Netty Server and dependencies

Added new libraries to the Chromium third-party library collection:
1. Netty 4 Server. See http://netty.io
2. Netty fork of Tomcat Native (netty-tcnative). See http://netty.io/wiki/forked-tomcat-native.html
and the library tc-native depends on:
3. 'Apache Portable Runtime'. See http://apr.apache.org

The server provides support for Http/2 protocol, which is needed for testing some of the Cronet features
on Android, in particular, the new Bidirectional Streaming API.

To build the netty-tcnative library call:
ninja -C out/Debug netty-tcnative

The output files can be found here:
- out/Debug/lib/libnetty-tcnative.so
- out/Debug/lib.java/netty-tcnative.jar

BUG=563732

Committed: https://crrev.com/6dd98af3db0b8e809ed95ff66620181efbf3f8f1
Cr-Commit-Position: refs/heads/master@{#370791}

Review URL: https://codereview.chromium.org/1537473002

Cr-Commit-Position: refs/heads/master@{#372172}
parent 65b7f83a
......@@ -286,6 +286,7 @@ vs-chromium-project.txt
/third_party/angle
/third_party/angle_dx11
/third_party/apache-mime4j
/third_party/apache-portable-runtime/src
/third_party/apache-win32/bin/*.exe
/third_party/apache-win32/bin/*.dll
/third_party/apache-win32/bin/iconv/*.so
......@@ -367,6 +368,8 @@ vs-chromium-project.txt
/third_party/mocha
/third_party/mockito/src
/third_party/nacl_sdk_binaries/
/third_party/netty-tcnative/src
/third_party/netty4/src
/third_party/nss
/third_party/omaha/src/omaha
/third_party/openmax_dl/
......
......@@ -434,6 +434,9 @@ deps_os = {
'src/third_party/apache-mime4j':
Var('chromium_git') + '/chromium/deps/apache-mime4j.git' + '@' + '28cb1108bff4b6cf0a2e86ff58b3d025934ebe3a',
'src/third_party/apache-portable-runtime/src':
Var('chromium_git') + '/external/apache-portable-runtime.git' + '@' + 'c76a8c4277e09a82eaa229e35246edea1ee0a6a1',
'src/third_party/appurify-python/src':
Var('chromium_git') + '/external/github.com/appurify/appurify-python.git' + '@' + 'ee7abd5c5ae3106f72b2a0b9d2cb55094688e867',
......@@ -449,7 +452,7 @@ deps_os = {
'src/third_party/freetype-android/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + 'a512b0fe7a8d9db0e5aa9c0a4db1e92cb861722d',
'src/third_party/elfutils/src':
'src/third_party/elfutils/src':
Var('chromium_git') + '/external/elfutils.git' + '@' + '249673729a7e5dbd5de4f3760bdcaa3d23d154d7',
'src/third_party/httpcomponents-client':
......@@ -470,6 +473,12 @@ deps_os = {
'src/third_party/mockito/src':
Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '4d987dcd923b81525c42b1333e6c4e07440776c3',
'src/third_party/netty-tcnative/src':
Var('chromium_git') + '/external/netty-tcnative.git' + '@' + '12d01332921695e974175870175eb14a889313a1',
'src/third_party/netty4/src':
Var('chromium_git') + '/external/netty4.git' + '@' + 'e0f26303b4ce635365be19414d0ac81f2ef6ba3c',
'src/third_party/robolectric/lib':
Var('chromium_git') + '/chromium/third_party/robolectric.git' + '@' + '6b63c99a8b6967acdb42cbed0adb067c80efc810',
......
......@@ -381,6 +381,8 @@
'dependencies': [
'cronet_java',
'../net/net.gyp:net_java_test_support',
'../third_party/netty-tcnative/netty-tcnative.gyp:netty-tcnative',
'../third_party/netty4/netty.gyp:netty_all',
],
'variables': {
'apk_name': 'CronetTest',
......@@ -389,6 +391,9 @@
'asset_location': 'cronet/android/test/assets',
'native_lib_target': 'libcronet_tests',
'run_findbugs': 1,
'additional_bundled_libs': [
'>(netty_tcnative_so_file_location)',
],
},
'includes': [ '../build/java_apk.gypi' ],
},
......
......@@ -452,6 +452,7 @@ android_apk("cronet_test_apk") {
apk_name = "CronetTest"
android_manifest = "test/AndroidManifest.xml"
native_libs = [ "libcronet_tests.so" ]
loadable_modules = [ "$root_out_dir/libnetty-tcnative.so" ]
deps = [
":cronet_test_apk_assets",
......@@ -459,6 +460,8 @@ android_apk("cronet_test_apk") {
":cronet_test_apk_resources",
":cronet_tests",
"//base:base_java",
"//third_party/netty-tcnative:netty-tcnative_all",
"//third_party/netty4:netty_all",
]
run_findbugs = true
......
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
# Builds 'Apache Portable Runtime'. See http://apr.apache.org
static_library("apr") {
sources = [
"src/atomic/unix/builtins.c",
"src/atomic/unix/ia32.c",
"src/atomic/unix/mutex.c",
"src/atomic/unix/ppc.c",
"src/atomic/unix/s390.c",
"src/atomic/unix/solaris.c",
"src/dso/unix/dso.c",
"src/file_io/unix/buffer.c",
"src/file_io/unix/copy.c",
"src/file_io/unix/dir.c",
"src/file_io/unix/fileacc.c",
"src/file_io/unix/filedup.c",
"src/file_io/unix/filepath.c",
"src/file_io/unix/filepath_util.c",
"src/file_io/unix/filestat.c",
"src/file_io/unix/flock.c",
"src/file_io/unix/fullrw.c",
"src/file_io/unix/mktemp.c",
"src/file_io/unix/open.c",
"src/file_io/unix/pipe.c",
"src/file_io/unix/readwrite.c",
"src/file_io/unix/seek.c",
"src/file_io/unix/tempdir.c",
"src/include/apr_skiplist.h",
"src/include/arch/apr_private_common.h",
"src/include/arch/unix/apr_arch_atomic.h",
"src/include/arch/unix/apr_arch_dso.h",
"src/include/arch/unix/apr_arch_file_io.h",
"src/include/arch/unix/apr_arch_global_mutex.h",
"src/include/arch/unix/apr_arch_internal_time.h",
"src/include/arch/unix/apr_arch_misc.h",
"src/include/arch/unix/apr_arch_networkio.h",
"src/include/arch/unix/apr_arch_poll_private.h",
"src/include/arch/unix/apr_arch_proc_mutex.h",
"src/include/arch/unix/apr_arch_shm.h",
"src/include/arch/unix/apr_arch_thread_cond.h",
"src/include/arch/unix/apr_arch_thread_mutex.h",
"src/include/arch/unix/apr_arch_thread_rwlock.h",
"src/include/arch/unix/apr_arch_threadproc.h",
"src/include/arch/unix/apr_private.h",
"src/locks/unix/global_mutex.c",
"src/locks/unix/proc_mutex.c",
"src/locks/unix/thread_cond.c",
"src/locks/unix/thread_mutex.c",
"src/locks/unix/thread_rwlock.c",
"src/memory/unix/apr_pools.c",
"src/misc/unix/charset.c",
"src/misc/unix/env.c",
"src/misc/unix/errorcodes.c",
"src/misc/unix/getopt.c",
"src/misc/unix/otherchild.c",
"src/misc/unix/rand.c",
"src/misc/unix/start.c",
"src/misc/unix/version.c",
"src/mmap/unix/common.c",
"src/mmap/unix/mmap.c",
"src/network_io/unix/inet_ntop.c",
"src/network_io/unix/inet_pton.c",
"src/network_io/unix/multicast.c",
"src/network_io/unix/sendrecv.c",
"src/network_io/unix/sockaddr.c",
"src/network_io/unix/sockets.c",
"src/network_io/unix/sockopt.c",
"src/passwd/apr_getpass.c",
"src/poll/unix/epoll.c",
"src/poll/unix/kqueue.c",
"src/poll/unix/poll.c",
"src/poll/unix/pollcb.c",
"src/poll/unix/pollset.c",
"src/poll/unix/port.c",
"src/poll/unix/select.c",
"src/random/unix/apr_random.c",
"src/random/unix/sha2.c",
"src/random/unix/sha2.h",
"src/random/unix/sha2_glue.c",
"src/shmem/unix/shm.c",
"src/strings/apr_cpystrn.c",
"src/strings/apr_fnmatch.c",
"src/strings/apr_snprintf.c",
"src/strings/apr_strings.c",
"src/strings/apr_strnatcmp.c",
"src/strings/apr_strtok.c",
"src/support/unix/waitio.c",
"src/tables/apr_hash.c",
"src/tables/apr_skiplist.c",
"src/tables/apr_tables.c",
"src/threadproc/unix/proc.c",
"src/threadproc/unix/procsup.c",
"src/threadproc/unix/signals.c",
"src/threadproc/unix/thread.c",
"src/threadproc/unix/threadpriv.c",
"src/time/unix/time.c",
"src/time/unix/timestr.c",
"src/user/unix/groupinfo.c",
"src/user/unix/userinfo.c",
]
include_dirs = [
"src/include",
"src/include/arch/unix",
]
cflags = [
"-isystem" +
rebase_path("$android_ndk_root/sources/android/support/include",
root_build_dir),
"-w",
]
}
This diff is collapsed.
kapishnikov@chromium.org
mef@chromium.org
Name: Apache Portable Runtime
Short Name: apr
URL: https://apr.apache.org/download.cgi
MD5: 98492e965963f852ab29f9e61b2ad700 *apr-1.5.2.tar.gz
Version: 1.5.2
Date: April 29, 2015
License: Apache 2.0
License File: NOT_SHIPPED
Security Critical: no
The library is not security critical because it is used for tests only.
Do not link it into production code.
Description:
The Apache Portable Runtime Library provides a predictable and
consistent interface to underlying platform-specific
implementations, with an API to which software developers may code
and be assured of predictable if not identical behavior regardless
of the platform on which their software is built, relieving them of
the need to code special-case conditions to work around or take
advantage of platform-specific deficiencies or features.
Local Modifications:
1. Ran ./configure
2. See the other changes in diff.patch
# Builds 'Apache Portable Runtime'. See http://apr.apache.org
{
'targets': [
{
'target_name': 'apr',
'type': 'static_library',
'sources': [
'src/atomic/unix/builtins.c',
'src/atomic/unix/ia32.c',
'src/atomic/unix/mutex.c',
'src/atomic/unix/ppc.c',
'src/atomic/unix/s390.c',
'src/atomic/unix/solaris.c',
'src/dso/unix/dso.c',
'src/file_io/unix/buffer.c',
'src/file_io/unix/copy.c',
'src/file_io/unix/dir.c',
'src/file_io/unix/fileacc.c',
'src/file_io/unix/filedup.c',
'src/file_io/unix/filepath.c',
'src/file_io/unix/filepath_util.c',
'src/file_io/unix/filestat.c',
'src/file_io/unix/flock.c',
'src/file_io/unix/fullrw.c',
'src/file_io/unix/mktemp.c',
'src/file_io/unix/open.c',
'src/file_io/unix/pipe.c',
'src/file_io/unix/readwrite.c',
'src/file_io/unix/seek.c',
'src/file_io/unix/tempdir.c',
'src/include/apr_skiplist.h',
'src/include/arch/apr_private_common.h',
'src/include/arch/unix/apr_arch_atomic.h',
'src/include/arch/unix/apr_arch_dso.h',
'src/include/arch/unix/apr_arch_file_io.h',
'src/include/arch/unix/apr_arch_global_mutex.h',
'src/include/arch/unix/apr_arch_internal_time.h',
'src/include/arch/unix/apr_arch_misc.h',
'src/include/arch/unix/apr_arch_networkio.h',
'src/include/arch/unix/apr_arch_poll_private.h',
'src/include/arch/unix/apr_arch_proc_mutex.h',
'src/include/arch/unix/apr_arch_shm.h',
'src/include/arch/unix/apr_arch_thread_cond.h',
'src/include/arch/unix/apr_arch_thread_mutex.h',
'src/include/arch/unix/apr_arch_thread_rwlock.h',
'src/include/arch/unix/apr_arch_threadproc.h',
'src/include/arch/unix/apr_private.h',
'src/locks/unix/global_mutex.c',
'src/locks/unix/proc_mutex.c',
'src/locks/unix/thread_cond.c',
'src/locks/unix/thread_mutex.c',
'src/locks/unix/thread_rwlock.c',
'src/memory/unix/apr_pools.c',
'src/misc/unix/charset.c',
'src/misc/unix/env.c',
'src/misc/unix/errorcodes.c',
'src/misc/unix/getopt.c',
'src/misc/unix/otherchild.c',
'src/misc/unix/rand.c',
'src/misc/unix/start.c',
'src/misc/unix/version.c',
'src/mmap/unix/common.c',
'src/mmap/unix/mmap.c',
'src/network_io/unix/inet_ntop.c',
'src/network_io/unix/inet_pton.c',
'src/network_io/unix/multicast.c',
'src/network_io/unix/sendrecv.c',
'src/network_io/unix/sockaddr.c',
'src/network_io/unix/sockets.c',
'src/network_io/unix/sockopt.c',
'src/passwd/apr_getpass.c',
'src/poll/unix/epoll.c',
'src/poll/unix/kqueue.c',
'src/poll/unix/poll.c',
'src/poll/unix/pollcb.c',
'src/poll/unix/pollset.c',
'src/poll/unix/port.c',
'src/poll/unix/select.c',
'src/random/unix/apr_random.c',
'src/random/unix/sha2.c',
'src/random/unix/sha2.h',
'src/random/unix/sha2_glue.c',
'src/shmem/unix/shm.c',
'src/strings/apr_cpystrn.c',
'src/strings/apr_fnmatch.c',
'src/strings/apr_snprintf.c',
'src/strings/apr_strings.c',
'src/strings/apr_strnatcmp.c',
'src/strings/apr_strtok.c',
'src/support/unix/waitio.c',
'src/tables/apr_hash.c',
'src/tables/apr_skiplist.c',
'src/tables/apr_tables.c',
'src/threadproc/unix/proc.c',
'src/threadproc/unix/procsup.c',
'src/threadproc/unix/signals.c',
'src/threadproc/unix/thread.c',
'src/threadproc/unix/threadpriv.c',
'src/time/unix/time.c',
'src/time/unix/timestr.c',
'src/user/unix/groupinfo.c',
'src/user/unix/userinfo.c',
],
'include_dirs': [
'src/include',
'src/include/arch/unix',
],
'cflags': [
'-isystem<(android_ndk_root)/sources/android/support/include',
'-w',
],
},
],
}
\ No newline at end of file
diff -ruN ./original/include/apr.h ./changed/include/apr.h
--- ./original/include/apr.h 2016-01-04 13:12:47.009354091 -0500
+++ ./changed/include/apr.h 2016-01-04 10:18:31.701765503 -0500
@@ -80,7 +80,7 @@
#define APR_HAVE_LIMITS_H 1
#define APR_HAVE_NETDB_H 1
#define APR_HAVE_NETINET_IN_H 1
-#define APR_HAVE_NETINET_SCTP_H 1
+#define APR_HAVE_NETINET_SCTP_H 0
#define APR_HAVE_NETINET_SCTP_UIO_H 0
#define APR_HAVE_NETINET_TCP_H 1
#define APR_HAVE_PROCESS_H 0
@@ -220,19 +220,19 @@
#define APR_USE_SHMEM_MMAP_SHM 0
#define APR_USE_SHMEM_MMAP_ZERO 0
#define APR_USE_SHMEM_SHMGET_ANON 0
-#define APR_USE_SHMEM_SHMGET 1
+#define APR_USE_SHMEM_SHMGET 0
#define APR_USE_SHMEM_MMAP_ANON 1
#define APR_USE_SHMEM_BEOS 0
#define APR_USE_FLOCK_SERIALIZE 0
-#define APR_USE_SYSVSEM_SERIALIZE 1
+#define APR_USE_SYSVSEM_SERIALIZE 0
#define APR_USE_POSIXSEM_SERIALIZE 0
#define APR_USE_FCNTL_SERIALIZE 0
#define APR_USE_PROC_PTHREAD_SERIALIZE 0
#define APR_USE_PTHREAD_SERIALIZE 1
#define APR_HAS_FLOCK_SERIALIZE 1
-#define APR_HAS_SYSVSEM_SERIALIZE 1
+#define APR_HAS_SYSVSEM_SERIALIZE 0
#define APR_HAS_POSIXSEM_SERIALIZE 1
#define APR_HAS_FCNTL_SERIALIZE 1
#define APR_HAS_PROC_PTHREAD_SERIALIZE 1
@@ -260,7 +260,7 @@
#define APR_HAVE_MEMCHR 1
#define APR_HAVE_STRUCT_RLIMIT 1
#define APR_HAVE_UNION_SEMUN 0
-#define APR_HAVE_SCTP 1
+#define APR_HAVE_SCTP 0
#define APR_HAVE_IOVEC 1
/* APR Feature Macros */
@@ -278,7 +278,7 @@
#define APR_HAS_USER 1
#define APR_HAS_LARGE_FILES 0
#define APR_HAS_XTHREAD_FILES 0
-#define APR_HAS_OS_UUID 1
+#define APR_HAS_OS_UUID 0
#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
@@ -349,8 +349,8 @@
#define UINT64_C(v) (v ## ULL)
#endif
#else
- typedef long apr_int64_t;
- typedef unsigned long apr_uint64_t;
+ typedef long long apr_int64_t;
+ typedef unsigned long long apr_uint64_t;
#endif
typedef size_t apr_size_t;
diff -ruN ./original/include/arch/netware/DEPS ./changed/include/arch/netware/DEPS
--- ./original/include/arch/netware/DEPS 1969-12-31 19:00:00.000000000 -0500
+++ ./changed/include/arch/netware/DEPS 2016-01-04 10:18:31.705765573 -0500
@@ -0,0 +1,3 @@
+include_rules = [
+ '+../original/apr_private_common.h',
+]
diff -ruN ./original/include/arch/unix/apr_private.h ./changed/include/arch/unix/apr_private.h
--- ./original/include/arch/unix/apr_private.h 2016-01-04 13:12:47.193357456 -0500
+++ ./changed/include/arch/unix/apr_private.h 2016-01-04 10:18:31.705765573 -0500
@@ -31,7 +31,7 @@
#define DEV_RANDOM "/dev/urandom"
/* Define if struct dirent has an inode member */
-#define DIRENT_INODE d_fileno
+/* #define DIRENT_INODE d_fileno */
/* Define if struct dirent has a d_type member */
#define DIRENT_TYPE d_type
@@ -73,7 +73,7 @@
/* #undef GETSERVBYNAME_IS_THREAD_SAFE */
/* Define if getservbyname_r has the glibc style */
-#define GETSERVBYNAME_R_GLIBC2 1
+/* #define GETSERVBYNAME_R_GLIBC2 1 */
/* Define if getservbyname_r has the OSF/1 style */
/* #undef GETSERVBYNAME_R_OSF1 */
@@ -82,7 +82,7 @@
/* #undef GETSERVBYNAME_R_SOLARIS */
/* Define if accept4 function is supported */
-#define HAVE_ACCEPT4 1
+/* #define HAVE_ACCEPT4 1 */
/* Define if async i/o supports message q's */
/* #undef HAVE_AIO_MSGQ */
@@ -141,7 +141,7 @@
/* #undef HAVE_DL_H */
/* Define if dup3 function is supported */
-#define HAVE_DUP3 1
+/* #define HAVE_DUP3 1 */
/* Define if EGD is supported */
/* #undef HAVE_EGD */
@@ -150,7 +150,7 @@
#define HAVE_EPOLL 1
/* Define if epoll_create1 function is supported */
-#define HAVE_EPOLL_CREATE1 1
+/* #define HAVE_EPOLL_CREATE1 1 */
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
@@ -195,13 +195,13 @@
#define HAVE_GETHOSTBYNAME_R 1
/* Define to 1 if you have the `getifaddrs' function. */
-#define HAVE_GETIFADDRS 1
+/* #define HAVE_GETIFADDRS 1 */
/* Define if getnameinfo exists */
#define HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `getpass' function. */
-#define HAVE_GETPASS 1
+/* #define HAVE_GETPASS 1 */
/* Define to 1 if you have the `getpassphrase' function. */
/* #undef HAVE_GETPASSPHRASE */
@@ -318,7 +318,7 @@
/* #undef HAVE_NET_ERRNO_H */
/* Define to 1 if you have the `nl_langinfo' function. */
-#define HAVE_NL_LANGINFO 1
+/* #define HAVE_NL_LANGINFO 1 */
/* Define to 1 if you have the <os2.h> header file. */
/* #undef HAVE_OS2_H */
@@ -360,7 +360,7 @@
#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
/* Define if cross-process robust mutexes are available */
-#define HAVE_PTHREAD_MUTEX_ROBUST 1
+/* #define HAVE_PTHREAD_MUTEX_ROBUST 1 */
/* Define if PTHREAD_PROCESS_SHARED is defined in pthread.h */
#define HAVE_PTHREAD_PROCESS_SHARED 1
@@ -372,7 +372,7 @@
#define HAVE_PTHREAD_RWLOCK_INIT 1
/* Define to 1 if you have the `pthread_yield' function. */
-#define HAVE_PTHREAD_YIELD 1
+/* #define HAVE_PTHREAD_YIELD 1 */
/* Define to 1 if you have the `putenv' function. */
#define HAVE_PUTENV 1
@@ -474,7 +474,7 @@
#define HAVE_SOCKLEN_T 1
/* Define if the SOCK_CLOEXEC flag is supported */
-#define HAVE_SOCK_CLOEXEC 1
+/* #define HAVE_SOCK_CLOEXEC 1 */
/* Define if SO_ACCEPTFILTER is defined in sys/socket.h */
/* #undef HAVE_SO_ACCEPTFILTER */
@@ -531,7 +531,7 @@
/* #undef HAVE_STRUCT_STAT_ST_ATIME_N */
/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+/* #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 0 */
/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -543,7 +543,7 @@
/* #undef HAVE_STRUCT_STAT_ST_CTIME_N */
/* Define to 1 if `st_ctim.tv_nsec' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1
+/* #define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 */
/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_MTIMENSEC */
@@ -552,7 +552,7 @@
/* #undef HAVE_STRUCT_STAT_ST_MTIME_N */
/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
-#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+/* #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 */
/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_GMTOFF 1
@@ -594,13 +594,13 @@
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/sem.h> header file. */
-#define HAVE_SYS_SEM_H 1
+/* #define HAVE_SYS_SEM_H 1 */
/* Define to 1 if you have the <sys/sendfile.h> header file. */
#define HAVE_SYS_SENDFILE_H 1
/* Define to 1 if you have the <sys/shm.h> header file. */
-#define HAVE_SYS_SHM_H 1
+/* #define HAVE_SYS_SHM_H 1 */
/* Define to 1 if you have the <sys/signal.h> header file. */
#define HAVE_SYS_SIGNAL_H 1
@@ -633,7 +633,7 @@
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <sys/uuid.h> header file. */
-/* #undef HAVE_SYS_UUID_H */
+#undef HAVE_SYS_UUID_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
@@ -687,7 +687,7 @@
/* #undef HAVE_UUID_H */
/* Define to 1 if you have the <uuid/uuid.h> header file. */
-#define HAVE_UUID_UUID_H 1
+/* #define HAVE_UUID_UUID_H 1 */
/* Define if C compiler supports VLA */
#define HAVE_VLA 1
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Builds the Netty fork of Tomcat Native. See http://netty.io/wiki/forked-tomcat-native.html
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
# Builds the native part of netty-tcnative library.
shared_library("netty-tcnative-so") {
output_name = "netty-tcnative"
sources = [
"src/c/address.c",
"src/c/bb.c",
"src/c/dir.c",
"src/c/error.c",
"src/c/file.c",
"src/c/info.c",
"src/c/jnilib.c",
"src/c/lock.c",
"src/c/misc.c",
"src/c/mmap.c",
"src/c/multicast.c",
"src/c/network.c",
"src/c/os.c",
"src/c/os_unix_system.c",
"src/c/os_unix_uxpipe.c",
"src/c/poll.c",
"src/c/pool.c",
"src/c/proc.c",
"src/c/shm.c",
"src/c/ssl.c",
"src/c/ssl_private.h",
"src/c/sslcontext.c",
"src/c/sslinfo.c",
"src/c/sslnetwork.c",
"src/c/sslutils.c",
"src/c/stdlib.c",
"src/c/tcn.h",
"src/c/tcn_api.h",
"src/c/tcn_version.h",
"src/c/thread.c",
"src/c/user.c",
]
include_dirs = [ "../apache-portable-runtime/src/include" ]
defines = [ "HAVE_OPENSSL" ]
cflags = [ "-w" ]
configs -= [ "//build/config/android:hide_native_jni_exports" ]
deps = [
"../apache-portable-runtime:apr",
"../boringssl:boringssl",
]
}
# Builds the Java part of netty-tcnative library.
android_library("netty-tcnative") {
java_files = [
"src/java/src/org/apache/tomcat/Apr.java",
"src/java/src/org/apache/tomcat/jni/Address.java",
"src/java/src/org/apache/tomcat/jni/BIOCallback.java",
"src/java/src/org/apache/tomcat/jni/Buffer.java",
"src/java/src/org/apache/tomcat/jni/CertificateVerifier.java",
"src/java/src/org/apache/tomcat/jni/Directory.java",
"src/java/src/org/apache/tomcat/jni/Error.java",
"src/java/src/org/apache/tomcat/jni/FileInfo.java",
"src/java/src/org/apache/tomcat/jni/File.java",
"src/java/src/org/apache/tomcat/jni/Global.java",
"src/java/src/org/apache/tomcat/jni/Library.java",
"src/java/src/org/apache/tomcat/jni/LibraryNotFoundError.java",
"src/java/src/org/apache/tomcat/jni/Local.java",
"src/java/src/org/apache/tomcat/jni/Lock.java",
"src/java/src/org/apache/tomcat/jni/Mmap.java",
"src/java/src/org/apache/tomcat/jni/Multicast.java",
"src/java/src/org/apache/tomcat/jni/OS.java",
"src/java/src/org/apache/tomcat/jni/PasswordCallback.java",
"src/java/src/org/apache/tomcat/jni/Poll.java",
"src/java/src/org/apache/tomcat/jni/PoolCallback.java",
"src/java/src/org/apache/tomcat/jni/Pool.java",
"src/java/src/org/apache/tomcat/jni/Procattr.java",
"src/java/src/org/apache/tomcat/jni/ProcErrorCallback.java",
"src/java/src/org/apache/tomcat/jni/Proc.java",
"src/java/src/org/apache/tomcat/jni/Registry.java",
"src/java/src/org/apache/tomcat/jni/SessionTicketKey.java",
"src/java/src/org/apache/tomcat/jni/Shm.java",
"src/java/src/org/apache/tomcat/jni/Sockaddr.java",
"src/java/src/org/apache/tomcat/jni/socket/AprSocketContext.java",
"src/java/src/org/apache/tomcat/jni/socket/AprSocket.java",
"src/java/src/org/apache/tomcat/jni/socket/HostInfo.java",
"src/java/src/org/apache/tomcat/jni/Socket.java",
"src/java/src/org/apache/tomcat/jni/SSLContext.java",
"src/java/src/org/apache/tomcat/jni/SSLExt.java",
"src/java/src/org/apache/tomcat/jni/SSL.java",
"src/java/src/org/apache/tomcat/jni/SSLSocket.java",
"src/java/src/org/apache/tomcat/jni/Status.java",
"src/java/src/org/apache/tomcat/jni/Stdlib.java",
"src/java/src/org/apache/tomcat/jni/Thread.java",
"src/java/src/org/apache/tomcat/jni/Time.java",
"src/java/src/org/apache/tomcat/jni/User.java",
]
run_findbugs = false
deps = [
"//base:base_java",
]
}
# Builds both the Java and native parts of netty-tcnative library.
group("netty-tcnative_all") {
deps = [
":netty-tcnative",
":netty-tcnative-so",
]
public_deps = [
":netty-tcnative-so",
]
}
This diff is collapsed.
kapishnikov@chromium.org
mef@chromium.org
Name: Tomcat Native Fork for Netty
Short Name: netty-tcnative
URL: https://github.com/netty/netty-tcnative
SHA: 856865181ca38c07b7d2be619903ee98f6f77a23 netty-tcnative-1.1.33.zip
Version: 1.1.33
Date: October 13, 2015
Revision: 2aa47be27783ec31086ca9881402f845543de4e6
License: Apache 2.0
License File: NOT_SHIPPED
Security Critical: no
The library is not security critical because it is used for tests only.
Do not link it into production code.
Description:
netty-tcnative is a fork of Tomcat Native. It includes a set of changes contributed
by Twitter, Inc, such as:
Simplified distribution and linkage of native library
Complete mavenization of the project
Improved OpenSSL support
Local Modifications:
diff -ruN ./original/src/main/c/ssl.c ./src/third_party/netty-tcnative/src/c/ssl.c
--- ./original/src/main/c/ssl.c 2015-10-13 08:36:59.000000000 -0400
+++ ./src/third_party/netty-tcnative/src/c/ssl.c 2016-01-04 10:18:31.729765992 -0500
@@ -1821,7 +1821,7 @@
verify = SSL_VERIFY_NONE;
UNREFERENCED(o);
- TCN_ASSERT(ctx != 0);
+ TCN_ASSERT(c->ctx != 0);
c->verify_mode = level;
if (c->verify_mode == SSL_CVERIFY_UNSET)
diff --git a/c/ssl.c b/c/ssl.c
index 89e6cad..97c7982 100644
--- a/c/ssl.c
+++ b/c/ssl.c
@@ -231,26 +231,38 @@ static const jint supported_ssl_opts = 0
static int ssl_tmp_key_init_rsa(int bits, int idx)
{
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(OPENSSL_USE_DEPRECATED)
- if (!(SSL_temp_keys[idx] =
- RSA_generate_key(bits, RSA_F4, NULL, NULL))) {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+ return 0;
+#else
+
#ifdef OPENSSL_FIPS
- /**
- * With FIPS mode short RSA keys cannot be
- * generated.
- */
- if (bits < 1024)
- return 0;
- else
-#endif
- return 1;
- }
- else {
+ /**
+ * Short RSA keys cannot be generated in FIPS mode.
+ */
+ if (bits < 1024)
return 0;
- }
-#else
- return 0;
#endif
+
+ BIGNUM *e = BN_new();
+ RSA *rsa = RSA_new();
+ int ret = 1;
+
+ if (e == NULL ||
+ rsa == NULL ||
+ !BN_set_word(e, RSA_F4) ||
+ RSA_generate_key_ex(rsa, bits, e, NULL) != 1) {
+ goto err;
+ }
+
+ SSL_temp_keys[idx] = rsa;
+ rsa = NULL;
+ ret = 0;
+
+err:
+ BN_free(e);
+ RSA_free(rsa);
+ return ret;
+#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
}
static int ssl_tmp_key_init_dh(int bits, int idx)
@@ -610,45 +622,6 @@ int SSL_rand_seed(const char *file)
return RAND_status();
}
-static int ssl_rand_make(const char *file, int len, int base64)
-{
- int r;
- int num = len;
- BIO *out = NULL;
-
- out = BIO_new(BIO_s_file());
- if (out == NULL)
- return 0;
- if ((r = BIO_write_filename(out, (char *)file)) < 0) {
- BIO_free_all(out);
- return 0;
- }
- if (base64) {
- BIO *b64 = BIO_new(BIO_f_base64());
- if (b64 == NULL) {
- BIO_free_all(out);
- return 0;
- }
- out = BIO_push(b64, out);
- }
- while (num > 0) {
- unsigned char buf[4096];
- int len = num;
- if (len > sizeof(buf))
- len = sizeof(buf);
- r = RAND_bytes(buf, len);
- if (r <= 0) {
- BIO_free_all(out);
- return 0;
- }
- BIO_write(out, buf, len);
- num -= len;
- }
- r = BIO_flush(out);
- BIO_free_all(out);
- return r > 0 ? 1 : 0;
-}
-
TCN_IMPLEMENT_CALL(jint, SSL, initialize)(TCN_STDARGS, jstring engine)
{
int r = 0;
@@ -785,17 +758,6 @@ TCN_IMPLEMENT_CALL(jboolean, SSL, randSave)(TCN_STDARGS, jstring file)
return r ? JNI_TRUE : JNI_FALSE;
}
-TCN_IMPLEMENT_CALL(jboolean, SSL, randMake)(TCN_STDARGS, jstring file,
- jint length, jboolean base64)
-{
- TCN_ALLOC_CSTRING(file);
- int r;
- UNREFERENCED(o);
- r = ssl_rand_make(J2S(file), length, base64);
- TCN_FREE_CSTRING(file);
- return r ? JNI_TRUE : JNI_FALSE;
-}
-
TCN_IMPLEMENT_CALL(void, SSL, randSet)(TCN_STDARGS, jstring file)
{
TCN_ALLOC_CSTRING(file);
# Builds the Netty fork of Tomcat Native. See http://netty.io/wiki/forked-tomcat-native.html
{
'targets': [
{
'target_name': 'netty-tcnative-so',
'product_name': 'netty-tcnative',
'type': 'shared_library',
'sources': [
'src/c/address.c',
'src/c/bb.c',
'src/c/dir.c',
'src/c/error.c',
'src/c/file.c',
'src/c/info.c',
'src/c/jnilib.c',
'src/c/lock.c',
'src/c/misc.c',
'src/c/mmap.c',
'src/c/multicast.c',
'src/c/network.c',
'src/c/os.c',
'src/c/os_unix_system.c',
'src/c/os_unix_uxpipe.c',
'src/c/poll.c',
'src/c/pool.c',
'src/c/proc.c',
'src/c/shm.c',
'src/c/ssl.c',
'src/c/sslcontext.c',
'src/c/sslinfo.c',
'src/c/sslnetwork.c',
'src/c/ssl_private.h',
'src/c/sslutils.c',
'src/c/stdlib.c',
'src/c/tcn_api.h',
'src/c/tcn.h',
'src/c/tcn_version.h',
'src/c/thread.c',
'src/c/user.c',
],
'include_dirs': [
'../apache-portable-runtime/src/include',
],
'defines': [
'HAVE_OPENSSL',
],
'cflags': [
'-w',
],
'dependencies': [
'../apache-portable-runtime/apr.gyp:apr',
'../boringssl/boringssl.gyp:boringssl',
],
'variables': {
'use_native_jni_exports': 1,
},
},
{
'target_name': 'netty-tcnative',
'type': 'none',
'variables': {
'java_in_dir': 'src/java',
'javac_includes': [ '**/org/apache/tomcat/jni/*.java' ],
'run_findbugs': 0,
},
'includes': [ '../../build/java.gypi' ],
'dependencies': [
'netty-tcnative-so',
'rename_netty_tcnative_so_file',
],
'export_dependent_settings': [
'rename_netty_tcnative_so_file',
],
},
{
# libnetty-tcnative shared library should have a specific name when
# it is copied to the test APK. This target renames (actually makes
# a copy of) the 'so' file if it has a different name.
'target_name': 'rename_netty_tcnative_so_file',
'type': 'none',
'conditions': [
['component=="shared_library"', {
'actions': [
{
'action_name': 'copy',
'inputs': ['<(PRODUCT_DIR)/lib/libnetty-tcnative.cr.so'],
'outputs': ['<(PRODUCT_DIR)/lib/libnetty-tcnative.so'],
'action': [
'cp',
'<@(_inputs)',
'<@(_outputs)',
],
}],
}],
],
'dependencies': [
'netty-tcnative-so',
],
'direct_dependent_settings': {
'variables': {
'netty_tcnative_so_file_location': '<(PRODUCT_DIR)/lib/libnetty-tcnative.so',
},
},
},
],
}
\ No newline at end of file
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# References prebuilt Netty Jar file. See http://netty.io/
import("//build/config/android/rules.gni")
android_java_prebuilt("netty_all") {
jar_path = "src/jar/all-in-one/netty-all-4.1.0.CR1-20160111.120759-50.jar"
}
This diff is collapsed.
kapishnikov@chromium.org
mef@chromium.org
Name: Netty
Short Name: netty
URL: http://netty.io/
SHA: f40598a04aae5fa4b24810f30aaaf4a61c9c4385 netty-4.1.0.Beta8.tar.bz2
Version: 4.1.0.Beta8
Date: November 10, 2015
License: Apache 2.0
License File: NOT_SHIPPED
Security Critical: no
The library is not security critical because it is used for tests only.
Do not link it into production code.
Description:
Netty is a NIO client server framework which enables quick and easy development
of network applications such as protocol servers and clients. It greatly
simplifies and streamlines network programming such as TCP and UDP socket server.
Local Modifications:
Replaced netty-all jar files with the nightly build version
and deleted all 4.1.0.Beta8 version jars.
URL: https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-all/4.1.0.CR1-SNAPSHOT/
SHA: 2748f46eca4216a08e75dd9ce618f61ed067c4f5 netty-all-4.1.0.CR1-20160111.120759-50-sources.jar
Date: January 11, 2016
URL: https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-all/4.1.0.CR1-SNAPSHOT/
SHA: 16cc4addd84c7fb3444e6d79f7d8cef74adefc7d netty-all-4.1.0.CR1-20160111.120759-50.jar
Date: January 11, 2016
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{ # This target references prebuilt Netty Jar file.
'target_name': 'netty_all',
'type' : 'none',
'variables': {
'jar_path': 'src/jar/all-in-one/netty-all-4.1.0.CR1-20160111.120759-50.jar',
'exclude_from_apk': 1,
},
'includes': ['../../build/java_prebuilt.gypi'],
},
],
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment