[Midnightbsd-cvs] src [9259] vendor/serf/dist: 1.3.9

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Feb 19 21:14:38 EST 2017


Revision: 9259
          http://svnweb.midnightbsd.org/src/?rev=9259
Author:   laffer1
Date:     2017-02-19 21:14:38 -0500 (Sun, 19 Feb 2017)
Log Message:
-----------
1.3.9

Modified Paths:
--------------
    vendor/serf/dist/CHANGES
    vendor/serf/dist/NOTICE
    vendor/serf/dist/README
    vendor/serf/dist/SConstruct
    vendor/serf/dist/auth/auth.c
    vendor/serf/dist/auth/auth.h
    vendor/serf/dist/auth/auth_basic.c
    vendor/serf/dist/auth/auth_digest.c
    vendor/serf/dist/auth/auth_spnego.c
    vendor/serf/dist/auth/auth_spnego.h
    vendor/serf/dist/auth/auth_spnego_gss.c
    vendor/serf/dist/auth/auth_spnego_sspi.c
    vendor/serf/dist/buckets/aggregate_buckets.c
    vendor/serf/dist/buckets/allocator.c
    vendor/serf/dist/buckets/barrier_buckets.c
    vendor/serf/dist/buckets/buckets.c
    vendor/serf/dist/buckets/bwtp_buckets.c
    vendor/serf/dist/buckets/chunk_buckets.c
    vendor/serf/dist/buckets/dechunk_buckets.c
    vendor/serf/dist/buckets/deflate_buckets.c
    vendor/serf/dist/buckets/file_buckets.c
    vendor/serf/dist/buckets/headers_buckets.c
    vendor/serf/dist/buckets/iovec_buckets.c
    vendor/serf/dist/buckets/limit_buckets.c
    vendor/serf/dist/buckets/mmap_buckets.c
    vendor/serf/dist/buckets/request_buckets.c
    vendor/serf/dist/buckets/response_body_buckets.c
    vendor/serf/dist/buckets/response_buckets.c
    vendor/serf/dist/buckets/simple_buckets.c
    vendor/serf/dist/buckets/socket_buckets.c
    vendor/serf/dist/buckets/ssl_buckets.c
    vendor/serf/dist/build/check.py
    vendor/serf/dist/build/gen_def.py
    vendor/serf/dist/context.c
    vendor/serf/dist/incoming.c
    vendor/serf/dist/outgoing.c
    vendor/serf/dist/serf.h
    vendor/serf/dist/serf_bucket_types.h
    vendor/serf/dist/serf_bucket_util.h
    vendor/serf/dist/serf_private.h
    vendor/serf/dist/ssltunnel.c
    vendor/serf/dist/test/mock_buckets.c
    vendor/serf/dist/test/serf_bwtp.c
    vendor/serf/dist/test/serf_get.c
    vendor/serf/dist/test/serf_request.c
    vendor/serf/dist/test/serf_response.c
    vendor/serf/dist/test/serf_server.c
    vendor/serf/dist/test/serf_spider.c
    vendor/serf/dist/test/server/test_server.c
    vendor/serf/dist/test/server/test_server.h
    vendor/serf/dist/test/server/test_sslserver.c
    vendor/serf/dist/test/test_all.c
    vendor/serf/dist/test/test_auth.c
    vendor/serf/dist/test/test_buckets.c
    vendor/serf/dist/test/test_context.c
    vendor/serf/dist/test/test_serf.h
    vendor/serf/dist/test/test_ssl.c
    vendor/serf/dist/test/test_util.c

Modified: vendor/serf/dist/CHANGES
===================================================================
--- vendor/serf/dist/CHANGES	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/CHANGES	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,9 +1,28 @@
-Serf 1.3.8 [2014-10-20, from /tags/1.3.8, rxxxx]
-Fix issue #152: CRC calculation error for gzipped http reponses > 4GB.
-Fix issue #153: SSPI CredHandle not freed when APR pool is destroyed.
-Fix issue #154: Disable SSLv2 and SSLv3 as both or broken.
+Apache Serf 1.3.9 [2016-09-01, from tags/1.3.9, rxxxx]
+  serf is now Apache Serf; apply header changes (r1700062)
+  Fix issue #151: SCons build broken when only one library in ENVPATH
+  Fix issue #153: avoid SSPI handle leak
+  Fix issue #167: Explicitly use the ANSI version of SSPI
+  Fix issue #170: Allow building with Microsoft Visual Studio 2015
+  Fix build of 'check' target when using VPATH-style builds (r1699858, ...)
+    (builddir != srcdir).
+  Resolve a bucket (aka "memory") leak when a request bucket is
+    destroyed before it is morphed into an aggregate bucket (r1699791)
+  Reset state variables when resetting connection (r1708849)
+  Fix types of passed, but unused batons (r1699986, r1699987)
+  Fix some usages of the openssl BIO api (r1699852)
+  Improve handling of bad data in the response state line. (r1699985)
+  Resolve several compiler issues with less common compilers
+  Support more overrides via SCons arguments (r1701836, ...)
+  Adapt to OpenSSL 1.1.x api (r1750819)
 
 
+Serf 1.3.8 [2014-10-20, from /tags/1.3.8, r2441]
+  Fix issue #152: CRC calculation error for gzipped http reponses > 4GB.
+  Fix issue #153: SSPI CredHandle not freed when APR pool is destroyed.
+  Fix issue #154: Disable SSLv2 and SSLv3 as both or broken.
+
+
 Serf 1.3.7 [2014-08-11, from /tags/1.3.7, r2411]
   Handle NUL bytes in fields of an X.509 certificate. (r2393, r2399)
 

Modified: vendor/serf/dist/NOTICE
===================================================================
--- vendor/serf/dist/NOTICE	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/NOTICE	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,2 +1,7 @@
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
+Apache Serf
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed by many people, and distributed
+under Contributor License Agreements to The Apache Software Foundation
+(http://www.apache.org/).  See the revision logs for an exact contribution
+history.

Modified: vendor/serf/dist/README
===================================================================
--- vendor/serf/dist/README	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/README	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,15 +1,14 @@
-Welcome to serf, a high-performance asynchronous HTTP client library.
+Welcome to Apache Serf, a high-performance asynchronous HTTP client library.
 
-The serf library is a C-based HTTP client library built upon the Apache
+The Apache Serf library is a C-based HTTP client library built upon the Apache
 Portable Runtime (APR) library. It multiplexes connections, running the
 read/write communication asynchronously. Memory copies and transformations are
 kept to a minimum to provide high performance operation.
 
-  * Status: http://code.google.com/p/serf/wiki/
-  * Site: http://code.google.com/p/serf/
-  * Code: http://serf.googlecode.com/svn/
-  * Issues: http://code.google.com/p/serf/issues/list
-  * Mail: serf-dev at googlegroups.com
+  * Site: http://serf.apache.org//
+  * Code: http://svn.apache.org/repos/asf/serf/
+  * Issues: https://issues.apache.org/jira/browse/SERF
+  * Mail: dev at serf.apache.org
   * People: Justin Erenkrantz, Greg Stein 
 
 ----
@@ -18,8 +17,8 @@
 
 1.1. SCons build system
 
-serf uses SCons 2.3 for its build system. If it is not installed on
-your system, then you can install it onto your system. If you do not
+Apache Serf uses SCons 2.3 for its build system. If it is not installed
+on your system, then you can install it onto your system. If you do not
 have permissions, then you can download and install the "local"
 version into your home directory. When installed privately, simply
 create a symlink for 'scons' in your PATH to /path/to/scons/scons.py.
@@ -28,7 +27,7 @@
   http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
 
 
-1.2 Building serf
+1.2 Building Apache Serf
 
 To build serf:
 
@@ -70,7 +69,7 @@
 $ scons check
 
 
-1.4 Installing serf
+1.4 Installing Apache Serf
 
 $ scons install
 

Modified: vendor/serf/dist/SConstruct
===================================================================
--- vendor/serf/dist/SConstruct	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/SConstruct	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,19 +1,24 @@
 # -*- python -*-
 #
-# Copyright 2011-2012 Justin Erenkrantz and Greg Stein
+# ====================================================================
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied.  See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+# ====================================================================
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
 
 import sys
 import os
@@ -135,7 +140,8 @@
     EnumVariable('MSVC_VERSION',
                  "Visual C++ to use for building (E.g. 11.0, 9.0)",
                  None,
-                 allowed_values=('12.0', '11.0', '10.0', '9.0', '8.0', '6.0')
+                 allowed_values=('14.0', '12.0',
+                                 '11.0', '10.0', '9.0', '8.0', '6.0')
                 ),
 
     # We always documented that we handle an install layout, but in fact we
@@ -177,8 +183,7 @@
 
 unknown = opts.UnknownVariables()
 if unknown:
-  print 'Unknown variables:', ', '.join(unknown.keys())
-  Exit(1)
+  print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
 
 apr = str(env['APR'])
 apu = str(env['APU'])
@@ -210,7 +215,8 @@
 # Unfortunately we can't set the .dylib compatibility_version option separately
 # from current_version, so don't use the PATCH level to avoid that build and
 # runtime patch levels have to be identical.
-env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)
+if sys.platform != 'sunos5':
+  env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)
 
 LIBNAME = 'libserf-%d' % (MAJOR,)
 if sys.platform != 'win32':
@@ -223,31 +229,43 @@
 
 if sys.platform == 'darwin':
 #  linkflags.append('-Wl,-install_name, at executable_path/%s.dylib' % (LIBNAME,))
-  env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,))
+  env.Append(LINKFLAGS=['-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)])
 
 if sys.platform != 'win32':
-  ### gcc only. figure out appropriate test / better way to check these
-  ### flags, and check for gcc.
-  env.Append(CFLAGS='-std=c89')
+  def CheckGnuCC(context):
+    src = '''
+    #ifndef __GNUC__
+    oh noes!
+    #endif
+    '''
+    context.Message('Checking for GNU-compatible C compiler...')
+    result = context.TryCompile(src, '.c')
+    context.Result(result)
+    return result
 
-  ### These warnings are not available on Solaris
-  if sys.platform != 'sunos5': 
+  conf = Configure(env, custom_tests = dict(CheckGnuCC=CheckGnuCC))
+  have_gcc = conf.CheckGnuCC()
+  env = conf.Finish()
+
+  if have_gcc:
+    env.Append(CFLAGS=['-std=c89'])
     env.Append(CCFLAGS=['-Wdeclaration-after-statement',
                         '-Wmissing-prototypes',
                         '-Wall'])
 
   if debug:
-    env.Append(CCFLAGS='-g')
+    env.Append(CCFLAGS=['-g'])
     env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
   else:
-    env.Append(CCFLAGS='-O2')
-    env.Append(CPPDEFINES='NDEBUG')
+    env.Append(CCFLAGS=['-O2'])
+    env.Append(CPPDEFINES=['NDEBUG'])
 
   ### works for Mac OS. probably needs to change
   env.Append(LIBS=['ssl', 'crypto', 'z', ])
 
   if sys.platform == 'sunos5':
-    env.Append(LIBS='m')
+    env.Append(LIBS=['m'])
+    env.Append(PLATFORM='posix')
 else:
   # Warning level 4, no unused argument warnings
   env.Append(CCFLAGS=['/W4', '/wd4100'])
@@ -260,8 +278,8 @@
   else:
     # Optimize for speed, use DLL runtime
     env.Append(CCFLAGS=['/O2', '/MD'])
-    env.Append(CPPDEFINES='NDEBUG')
-    env.Append(LINKFLAGS='/RELEASE')
+    env.Append(CPPDEFINES=['NDEBUG'])
+    env.Append(LINKFLAGS=['/RELEASE'])
 
 # PLAN THE BUILD
 SHARED_SOURCES = []
@@ -291,6 +309,7 @@
   if aprstatic:
     apr_libs='apr-1.lib'
     apu_libs='aprutil-1.lib'
+    env.Append(LIBS=['shell32.lib', 'xml.lib'])
   else:
     apr_libs='libapr-1.lib'
     apu_libs='libaprutil-1.lib'
@@ -307,25 +326,25 @@
                CPPPATH=['$APR/include', '$APU/include'])
 
   # zlib
-  env.Append(LIBS='zlib.lib')
+  env.Append(LIBS=['zlib.lib'])
   if not env.get('SOURCE_LAYOUT', None):
-    env.Append(CPPPATH='$ZLIB/include',
-               LIBPATH='$ZLIB/lib')
+    env.Append(CPPPATH=['$ZLIB/include'],
+               LIBPATH=['$ZLIB/lib'])
   else:
-    env.Append(CPPPATH='$ZLIB',
-               LIBPATH='$ZLIB')
+    env.Append(CPPPATH=['$ZLIB'],
+               LIBPATH=['$ZLIB'])
 
   # openssl
   env.Append(LIBS=['libeay32.lib', 'ssleay32.lib'])
   if not env.get('SOURCE_LAYOUT', None):
-    env.Append(CPPPATH='$OPENSSL/include/openssl',
-               LIBPATH='$OPENSSL/lib')
+    env.Append(CPPPATH=['$OPENSSL/include/openssl'],
+               LIBPATH=['$OPENSSL/lib'])
   elif 0: # opensslstatic:
-    env.Append(CPPPATH='$OPENSSL/inc32',
-               LIBPATH='$OPENSSL/out32')
+    env.Append(CPPPATH=['$OPENSSL/inc32'],
+               LIBPATH=['$OPENSSL/out32'])
   else:
-    env.Append(CPPPATH='$OPENSSL/inc32',
-               LIBPATH='$OPENSSL/out32dll')
+    env.Append(CPPPATH=['$OPENSSL/inc32'],
+               LIBPATH=['$OPENSSL/out32dll'])
 else:
   if os.path.isdir(apr):
     apr = os.path.join(apr, 'bin', 'apr-1-config')
@@ -351,8 +370,8 @@
     apr_libs = ''
     apu_libs = ''
 
-  env.Append(CPPPATH='$OPENSSL/include')
-  env.Append(LIBPATH='$OPENSSL/lib')
+  env.Append(CPPPATH=['$OPENSSL/include'])
+  env.Append(LIBPATH=['$OPENSSL/lib'])
 
 
 # If build with gssapi, get its information and define SERF_HAVE_GSSAPI
@@ -362,7 +381,7 @@
         env['GSSAPI_LIBS'] = cmd.strip()
         return env.MergeFlags(cmd, unique)
     env.ParseConfig('$GSSAPI --libs gssapi', parse_libs)
-    env.Append(CPPDEFINES='SERF_HAVE_GSSAPI')
+    env.Append(CPPDEFINES=['SERF_HAVE_GSSAPI'])
 if sys.platform == 'win32':
   env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
 
@@ -428,6 +447,12 @@
 
 tenv = env.Clone()
 
+# MockHTTP requires C99 standard, so use it for the test suite.
+cflags = tenv['CFLAGS']
+tenv.Replace(CFLAGS = [f.replace('-std=c89', '-std=c99') for f in cflags])
+
+tenv.Append(CPPDEFINES=['MOCKHTTP_OPENSSL'])
+
 TEST_PROGRAMS = [ 'serf_get', 'serf_response', 'serf_request', 'serf_spider',
                   'test_all', 'serf_bwtp' ]
 if sys.platform == 'win32':
@@ -435,14 +460,23 @@
 else:
   TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ]
 
-env.AlwaysBuild(env.Alias('check', TEST_EXES, sys.executable + ' build/check.py',
-                          ENV={'PATH' : os.environ['PATH']}))
-
 # Find the (dynamic) library in this directory
 tenv.Replace(RPATH=thisdir)
 tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
              LIBPATH=[thisdir, ])
 
+check_script = env.File('build/check.py').rstr()
+test_dir = env.File('test/test_all.c').rfile().get_dir()
+src_dir = env.File('serf.h').rfile().get_dir()
+test_app = ("%s %s %s %s") % (sys.executable, check_script, test_dir, 'test')
+
+# Set the library search path for the test programs
+test_env = {'PATH' : os.environ['PATH'],
+            'srcdir' : src_dir}
+if sys.platform != 'win32':
+  test_env['LD_LIBRARY_PATH'] = ':'.join(tenv.get('LIBPATH', []))
+env.AlwaysBuild(env.Alias('check', TEST_EXES, test_app, ENV=test_env))
+
 testall_files = [
         'test/test_all.c',
         'test/CuTest.c',

Modified: vendor/serf/dist/auth/auth.c
===================================================================
--- vendor/serf/dist/auth/auth.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "serf.h"

Modified: vendor/serf/dist/auth/auth.h
===================================================================
--- vendor/serf/dist/auth/auth.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef AUTH_H

Modified: vendor/serf/dist/auth/auth_basic.c
===================================================================
--- vendor/serf/dist/auth/auth_basic.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_basic.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 /*** Basic authentication ***/

Modified: vendor/serf/dist/auth/auth_digest.c
===================================================================
--- vendor/serf/dist/auth/auth_digest.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_digest.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 /*** Digest authentication ***/

Modified: vendor/serf/dist/auth/auth_spnego.c
===================================================================
--- vendor/serf/dist/auth/auth_spnego.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_spnego.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,18 +1,24 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
+
 #include "auth_spnego.h"
 
 #ifdef SERF_HAVE_SPNEGO

Modified: vendor/serf/dist/auth/auth_spnego.h
===================================================================
--- vendor/serf/dist/auth/auth_spnego.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_spnego.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2010 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef AUTH_SPNEGO_H

Modified: vendor/serf/dist/auth/auth_spnego_gss.c
===================================================================
--- vendor/serf/dist/auth/auth_spnego_gss.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_spnego_gss.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2009 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "serf.h"

Modified: vendor/serf/dist/auth/auth_spnego_sspi.c
===================================================================
--- vendor/serf/dist/auth/auth_spnego_sspi.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/auth/auth_spnego_sspi.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2010 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "auth_spnego.h"
@@ -138,7 +143,7 @@
     else
         sspi_package = "NTLM";
 
-    sspi_status = AcquireCredentialsHandle(
+    sspi_status = AcquireCredentialsHandleA(
         NULL, sspi_package, SECPKG_CRED_OUTBOUND,
         NULL, NULL, NULL, NULL,
         &ctx->sspi_credentials, NULL);
@@ -247,7 +252,7 @@
     sspi_out_buffer_desc.pBuffers = &sspi_out_buffer;
     sspi_out_buffer_desc.ulVersion = SECBUFFER_VERSION;
 
-    status = InitializeSecurityContext(
+    status = InitializeSecurityContextA(
         &ctx->sspi_credentials,
         ctx->initalized ? &ctx->sspi_context : NULL,
         ctx->target_name,

Modified: vendor/serf/dist/buckets/aggregate_buckets.c
===================================================================
--- vendor/serf/dist/buckets/aggregate_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/aggregate_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "serf.h"

Modified: vendor/serf/dist/buckets/allocator.c
===================================================================
--- vendor/serf/dist/buckets/allocator.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/allocator.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/buckets/barrier_buckets.c
===================================================================
--- vendor/serf/dist/buckets/barrier_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/barrier_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/buckets.c
===================================================================
--- vendor/serf/dist/buckets/buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/bwtp_buckets.c
===================================================================
--- vendor/serf/dist/buckets/bwtp_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/bwtp_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/chunk_buckets.c
===================================================================
--- vendor/serf/dist/buckets/chunk_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/chunk_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/dechunk_buckets.c
===================================================================
--- vendor/serf/dist/buckets/dechunk_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/dechunk_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_strings.h>

Modified: vendor/serf/dist/buckets/deflate_buckets.c
===================================================================
--- vendor/serf/dist/buckets/deflate_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/deflate_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_strings.h>

Modified: vendor/serf/dist/buckets/file_buckets.c
===================================================================
--- vendor/serf/dist/buckets/file_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/file_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/headers_buckets.c
===================================================================
--- vendor/serf/dist/buckets/headers_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/headers_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/buckets/iovec_buckets.c
===================================================================
--- vendor/serf/dist/buckets/iovec_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/iovec_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2011 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/limit_buckets.c
===================================================================
--- vendor/serf/dist/buckets/limit_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/limit_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/mmap_buckets.c
===================================================================
--- vendor/serf/dist/buckets/mmap_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/mmap_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/request_buckets.c
===================================================================
--- vendor/serf/dist/buckets/request_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/request_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>
@@ -190,6 +195,20 @@
     return serf_bucket_peek(bucket, data, len);
 }
 
+/* Note that this function is only called when serialize_data()
+   hasn't been called on the bucket */
+static void serf_request_destroy(serf_bucket_t *bucket)
+{
+  request_context_t *ctx = bucket->data;
+
+  serf_bucket_destroy(ctx->headers);
+
+  if (ctx->body)
+    serf_bucket_destroy(ctx->body);
+
+  serf_default_destroy_and_data(bucket);
+}
+
 void serf_bucket_request_become(
     serf_bucket_t *bucket,
     const char *method,
@@ -218,6 +237,6 @@
     serf_default_read_for_sendfile,
     serf_default_read_bucket,
     serf_request_peek,
-    serf_default_destroy_and_data,
+    serf_request_destroy,
 };
 

Modified: vendor/serf/dist/buckets/response_body_buckets.c
===================================================================
--- vendor/serf/dist/buckets/response_body_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/response_body_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/response_buckets.c
===================================================================
--- vendor/serf/dist/buckets/response_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/response_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_lib.h>
@@ -128,7 +133,17 @@
     int res;
     char *reason; /* ### stupid APR interface makes this non-const */
 
-    /* ctx->linebuf.line should be of form: HTTP/1.1 200 OK */
+    /* Ensure a valid length, to avoid overflow on the final '\0' */
+    if (ctx->linebuf.used >= SERF_LINEBUF_LIMIT) {
+       return SERF_ERROR_BAD_HTTP_RESPONSE;
+    }
+
+    /* apr_date_checkmask assumes its arguments are valid C strings */
+    ctx->linebuf.line[ctx->linebuf.used] = '\0';
+
+    /* ctx->linebuf.line should be of form: 'HTTP/1.1 200 OK',
+       but we also explicitly allow the forms 'HTTP/1.1 200' (no reason)
+       and 'HTTP/1.1 401.1 Logon failed' (iis extended error codes) */
     res = apr_date_checkmask(ctx->linebuf.line, "HTTP/#.# ###*");
     if (!res) {
         /* Not an HTTP response?  Well, at least we won't understand it. */

Modified: vendor/serf/dist/buckets/simple_buckets.c
===================================================================
--- vendor/serf/dist/buckets/simple_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/simple_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/socket_buckets.c
===================================================================
--- vendor/serf/dist/buckets/socket_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/socket_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/buckets/ssl_buckets.c
===================================================================
--- vendor/serf/dist/buckets/ssl_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/buckets/ssl_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,36 +1,24 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
  * ----
  *
- * For the OpenSSL thread-safety locking code:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
  * Originally developed by Aaron Bannert and Justin Erenkrantz, eBuilt.
  */
 
@@ -64,7 +52,11 @@
 #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
 #endif
 
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
+#define USE_OPENSSL_1_1_API
+#endif
 
+
 /*
  * Here's an overview of the SSL bucket's relationship to OpenSSL and serf.
  *
@@ -152,6 +144,7 @@
     SSL_CTX *ctx;
     SSL *ssl;
     BIO *bio;
+    BIO_METHOD *biom;
 
     serf_ssl_stream_t encrypt;
     serf_ssl_stream_t decrypt;
@@ -244,10 +237,28 @@
 }
 #endif
 
+static void bio_set_data(BIO *bio, void *data)
+{
+#ifdef USE_OPENSSL_1_1_API
+    BIO_set_data(bio, data);
+#else
+    bio->ptr = data;
+#endif
+}
+
+static void *bio_get_data(BIO *bio)
+{
+#ifdef USE_OPENSSL_1_1_API
+    return BIO_get_data(bio);
+#else
+    return bio->ptr;
+#endif
+}
+
 /* Returns the amount read. */
 static int bio_bucket_read(BIO *bio, char *in, int inlen)
 {
-    serf_ssl_context_t *ctx = bio->ptr;
+    serf_ssl_context_t *ctx = bio_get_data(bio);
     const char *data;
     apr_status_t status;
     apr_size_t len;
@@ -291,7 +302,7 @@
 /* Returns the amount written. */
 static int bio_bucket_write(BIO *bio, const char *in, int inl)
 {
-    serf_ssl_context_t *ctx = bio->ptr;
+    serf_ssl_context_t *ctx = bio_get_data(bio);
     serf_bucket_t *tmp;
 
     serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_write called for %d bytes\n",
@@ -319,12 +330,10 @@
 /* Returns the amount read. */
 static int bio_file_read(BIO *bio, char *in, int inlen)
 {
-    apr_file_t *file = bio->ptr;
+    apr_file_t *file = bio_get_data(bio);
     apr_status_t status;
     apr_size_t len;
 
-    BIO_clear_retry_flags(bio);
-
     len = inlen;
     status = apr_file_read(file, in, &len);
 
@@ -331,7 +340,6 @@
     if (!SERF_BUCKET_READ_ERROR(status)) {
         /* Oh suck. */
         if (APR_STATUS_IS_EOF(status)) {
-            BIO_set_retry_read(bio);
             return -1;
         } else {
             return len;
@@ -344,7 +352,7 @@
 /* Returns the amount written. */
 static int bio_file_write(BIO *bio, const char *in, int inl)
 {
-    apr_file_t *file = bio->ptr;
+    apr_file_t *file = bio_get_data(bio);
     apr_size_t nbytes;
 
     BIO_clear_retry_flags(bio);
@@ -357,15 +365,32 @@
 
 static int bio_file_gets(BIO *bio, char *in, int inlen)
 {
-    return bio_file_read(bio, in, inlen);
+    apr_file_t *file = bio_get_data(bio);
+    apr_status_t status;
+
+    status = apr_file_gets(in, inlen, file);
+
+    if (! status) {
+        return (int)strlen(in);
+    } else if (APR_STATUS_IS_EOF(status)) {
+        return 0;
+    } else {
+        return -1; /* Signal generic error */
+    }
 }
 
 static int bio_bucket_create(BIO *bio)
 {
+#ifdef USE_OPENSSL_1_1_API
+    BIO_set_shutdown(bio, 1);
+    BIO_set_init(bio, 1);
+    BIO_set_data(bio, NULL);
+#else
     bio->shutdown = 1;
     bio->init = 1;
     bio->num = -1;
     bio->ptr = NULL;
+#endif
 
     return 1;
 }
@@ -399,6 +424,7 @@
     return ret;
 }
 
+#ifndef USE_OPENSSL_1_1_API
 static BIO_METHOD bio_bucket_method = {
     BIO_TYPE_MEM,
     "Serf SSL encryption and decryption buckets",
@@ -428,7 +454,56 @@
     NULL /* sslc does not have the callback_ctrl field */
 #endif
 };
+#endif
 
+static BIO_METHOD *bio_meth_bucket_new(void)
+{
+    BIO_METHOD *biom = NULL;
+
+#ifdef USE_OPENSSL_1_1_API
+    biom = BIO_meth_new(BIO_TYPE_MEM,
+                        "Serf SSL encryption and decryption buckets");
+    if (biom) {
+        BIO_meth_set_write(biom, bio_bucket_write);
+        BIO_meth_set_read(biom, bio_bucket_read);
+        BIO_meth_set_ctrl(biom, bio_bucket_ctrl);
+        BIO_meth_set_create(biom, bio_bucket_create);
+        BIO_meth_set_destroy(biom, bio_bucket_destroy);
+    }
+#else
+    biom = &bio_bucket_method;
+#endif
+
+    return biom;
+}
+
+static BIO_METHOD *bio_meth_file_new(void)
+{
+    BIO_METHOD *biom = NULL;
+
+#ifdef USE_OPENSSL_1_1_API
+    biom = BIO_meth_new(BIO_TYPE_FILE,
+                        "Wrapper around APR file structures");
+    BIO_meth_set_write(biom, bio_file_write);
+    BIO_meth_set_read(biom, bio_file_read);
+    BIO_meth_set_gets(biom, bio_file_gets);
+    BIO_meth_set_ctrl(biom, bio_bucket_ctrl);
+    BIO_meth_set_create(biom, bio_bucket_create);
+    BIO_meth_set_destroy(biom, bio_bucket_destroy);
+#else
+    biom = &bio_file_method;
+#endif
+
+    return biom;
+}
+
+static void bio_meth_free(BIO_METHOD *biom)
+{
+#ifdef USE_OPENSSL_1_1_API
+    BIO_meth_free(biom);
+#endif
+}
+
 typedef enum san_copy_t {
     EscapeNulAndCopy = 0,
     ErrorOnNul = 1,
@@ -977,7 +1052,7 @@
     return status;
 }
 
-#if APR_HAS_THREADS
+#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
 static apr_pool_t *ssl_pool;
 static apr_thread_mutex_t **ssl_locks;
 
@@ -1064,7 +1139,7 @@
     val = apr_atomic_cas32(&have_init_ssl, INIT_BUSY, INIT_UNINITIALIZED);
 
     if (!val) {
-#if APR_HAS_THREADS
+#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
         int i, numlocks;
 #endif
 
@@ -1081,13 +1156,17 @@
         }
 #endif
 
+#ifdef USE_OPENSSL_1_1_API
+        OPENSSL_malloc_init();
+#else
         CRYPTO_malloc_init();
+#endif
         ERR_load_crypto_strings();
         SSL_load_error_strings();
         SSL_library_init();
         OpenSSL_add_all_algorithms();
 
-#if APR_HAS_THREADS
+#if APR_HAS_THREADS && !defined(USE_OPENSSL_1_1_API)
         numlocks = CRYPTO_num_locks();
         apr_pool_create(&ssl_pool, NULL);
         ssl_locks = apr_palloc(ssl_pool, sizeof(apr_thread_mutex_t*)*numlocks);
@@ -1140,6 +1219,7 @@
         const char *cert_path;
         apr_file_t *cert_file;
         BIO *bio;
+        BIO_METHOD *biom;
         PKCS12 *p12;
         int i;
         int retrying_success = 0;
@@ -1165,8 +1245,9 @@
             continue;
         }
 
-        bio = BIO_new(&bio_file_method);
-        bio->ptr = cert_file;
+        biom = bio_meth_file_new();
+        bio = BIO_new(biom);
+        bio_set_data(bio, cert_file);
 
         ctx->cert_path = cert_path;
         p12 = d2i_PKCS12_bio(bio, NULL);
@@ -1176,6 +1257,7 @@
 
         if (i == 1) {
             PKCS12_free(p12);
+            bio_meth_free(biom);
             ctx->cached_cert = *cert;
             ctx->cached_cert_pw = *pkey;
             if (!retrying_success && ctx->cert_cache_pool) {
@@ -1211,6 +1293,7 @@
                         i = PKCS12_parse(p12, password, pkey, cert, NULL);
                         if (i == 1) {
                             PKCS12_free(p12);
+                            bio_meth_free(biom);
                             ctx->cached_cert = *cert;
                             ctx->cached_cert_pw = *pkey;
                             if (!retrying_success && ctx->cert_cache_pool) {
@@ -1238,6 +1321,7 @@
                     }
                 }
                 PKCS12_free(p12);
+                bio_meth_free(biom);
                 return 0;
             }
             else {
@@ -1245,6 +1329,7 @@
                        ERR_GET_FUNC(err),
                        ERR_GET_REASON(err));
                 PKCS12_free(p12);
+                bio_meth_free(biom);
             }
         }
     }
@@ -1339,8 +1424,9 @@
     disable_compression(ssl_ctx);
 
     ssl_ctx->ssl = SSL_new(ssl_ctx->ctx);
-    ssl_ctx->bio = BIO_new(&bio_bucket_method);
-    ssl_ctx->bio->ptr = ssl_ctx;
+    ssl_ctx->biom = bio_meth_bucket_new();
+    ssl_ctx->bio = BIO_new(ssl_ctx->biom);
+    bio_set_data(ssl_ctx->bio, ssl_ctx);
 
     SSL_set_bio(ssl_ctx->ssl, ssl_ctx->bio, ssl_ctx->bio);
 
@@ -1383,6 +1469,7 @@
 
     /* SSL_free implicitly frees the underlying BIO. */
     SSL_free(ssl_ctx->ssl);
+    bio_meth_free(ssl_ctx->biom);
     SSL_CTX_free(ssl_ctx->ctx);
 
     serf_bucket_mem_free(ssl_ctx->allocator, ssl_ctx);

Modified: vendor/serf/dist/build/check.py
===================================================================
--- vendor/serf/dist/build/check.py	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/build/check.py	2017-02-20 02:14:38 UTC (rev 9259)
@@ -2,21 +2,25 @@
 #
 # check.py :  Run all the test cases.
 #
-# ====================================================================
-#   Copyright 2013 Justin Erenkrantz and Greg Stein
+# ===================================================================
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+# ===================================================================
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-# ====================================================================
 
 import sys
 import glob
@@ -31,6 +35,11 @@
   else:
     testdir = 'test'
 
+  if len(sys.argv) > 2:
+    test_builddir = sys.argv[2]
+  else:
+    test_builddir = 'test'
+
   # define test executable paths
   if sys.platform == 'win32':
     SERF_RESPONSE_EXE = 'serf_response.exe'
@@ -38,8 +47,8 @@
   else:
     SERF_RESPONSE_EXE = 'serf_response'
     TEST_ALL_EXE = 'test_all'
-  SERF_RESPONSE_EXE = os.path.join(testdir, SERF_RESPONSE_EXE)
-  TEST_ALL_EXE = os.path.join(testdir, TEST_ALL_EXE)
+  SERF_RESPONSE_EXE = os.path.join(test_builddir, SERF_RESPONSE_EXE)
+  TEST_ALL_EXE = os.path.join(test_builddir, TEST_ALL_EXE)
 
   # Find test responses and run them one by one
   for case in glob.glob(testdir + "/testcases/*.response"):

Modified: vendor/serf/dist/build/gen_def.py
===================================================================
--- vendor/serf/dist/build/gen_def.py	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/build/gen_def.py	2017-02-20 02:14:38 UTC (rev 9259)
@@ -2,23 +2,25 @@
 #
 # gen_def.py :  Generate the .DEF file for Windows builds
 #
-# ====================================================================
-#   Copyright 2002-2010 Justin Erenkrantz and Greg Stein
+# ===================================================================
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+# ===================================================================
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-# ====================================================================
-#
-#
 # Typically, this script is used like:
 #
 #    C:\PATH> python build/gen_def.py serf.h serf_bucket_types.h serf_bucket_util.h > build/serf.def

Modified: vendor/serf/dist/context.c
===================================================================
--- vendor/serf/dist/context.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/context.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>
@@ -212,7 +217,7 @@
             tdesc.desc.s = conn->skt;
             tdesc.reqevents = conn->reqevents;
             ctx->pollset_rm(ctx->pollset_baton,
-                            &tdesc, conn);
+                            &tdesc, &conn->baton);
             return conn->status;
         }
         /* apr_pollset_poll() can return a conn multiple times... */
@@ -233,7 +238,7 @@
                 tdesc.desc.s = conn->skt;
                 tdesc.reqevents = conn->reqevents;
                 ctx->pollset_rm(ctx->pollset_baton,
-                                &tdesc, conn);
+                                &tdesc, &conn->baton);
             }
             return conn->status;
         }
@@ -295,9 +300,9 @@
     }
 
     while (num--) {
-        serf_connection_t *conn = desc->client_data;
+        serf_io_baton_t *io  = desc->client_data;
 
-        status = serf_event_trigger(ctx, conn, desc);
+        status = serf_event_trigger(ctx, io, desc);
         if (status) {
             return status;
         }

Modified: vendor/serf/dist/incoming.c
===================================================================
--- vendor/serf/dist/incoming.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/incoming.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/outgoing.c
===================================================================
--- vendor/serf/dist/outgoing.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/outgoing.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>
@@ -142,7 +147,7 @@
     desc.reqevents = conn->reqevents;
 
     status = ctx->pollset_rm(ctx->pollset_baton,
-                             &desc, conn);
+                             &desc, &conn->baton);
     if (status && !APR_STATUS_IS_NOTFOUND(status))
         return status;
 
@@ -547,7 +552,7 @@
     desc.reqevents = conn->reqevents;
 
     return ctx->pollset_rm(ctx->pollset_baton,
-                           &desc, conn);
+                           &desc, &conn->baton);
 }
 
 /* A socket was closed, inform the application. */
@@ -623,6 +628,11 @@
     conn->ctx->dirty_pollset = 1;
     conn->state = SERF_CONN_INIT;
 
+    conn->hit_eof = 0;
+    conn->connect_time = 0;
+    conn->latency = -1;
+    conn->stop_writing = 0;
+
     serf__log(CONN_VERBOSE, __FILE__, "reset connection 0x%x\n", conn);
 
     conn->status = APR_SUCCESS;

Modified: vendor/serf/dist/serf.h
===================================================================
--- vendor/serf/dist/serf.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/serf.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef SERF_H
@@ -1062,7 +1067,7 @@
 /* Version info */
 #define SERF_MAJOR_VERSION 1
 #define SERF_MINOR_VERSION 3
-#define SERF_PATCH_VERSION 8
+#define SERF_PATCH_VERSION 9
 
 /* Version number string */
 #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \

Modified: vendor/serf/dist/serf_bucket_types.h
===================================================================
--- vendor/serf/dist/serf_bucket_types.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/serf_bucket_types.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef SERF_BUCKET_TYPES_H

Modified: vendor/serf/dist/serf_bucket_util.h
===================================================================
--- vendor/serf/dist/serf_bucket_util.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/serf_bucket_util.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef SERF_BUCKET_UTIL_H

Modified: vendor/serf/dist/serf_private.h
===================================================================
--- vendor/serf/dist/serf_private.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/serf_private.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef _SERF_PRIVATE_H_

Modified: vendor/serf/dist/ssltunnel.c
===================================================================
--- vendor/serf/dist/ssltunnel.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/ssltunnel.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2011 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 /*** Setup a SSL tunnel over a HTTP proxy, according to RFC 2817. ***/

Modified: vendor/serf/dist/test/mock_buckets.c
===================================================================
--- vendor/serf/dist/test/mock_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/mock_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2013 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_pools.h>

Modified: vendor/serf/dist/test/serf_bwtp.c
===================================================================
--- vendor/serf/dist/test/serf_bwtp.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_bwtp.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/serf_get.c
===================================================================
--- vendor/serf/dist/test/serf_get.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_get.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/serf_request.c
===================================================================
--- vendor/serf/dist/test/serf_request.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_request.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/serf_response.c
===================================================================
--- vendor/serf/dist/test/serf_response.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_response.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/serf_server.c
===================================================================
--- vendor/serf/dist/test/serf_server.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_server.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/serf_spider.c
===================================================================
--- vendor/serf/dist/test/serf_spider.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/serf_spider.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>

Modified: vendor/serf/dist/test/server/test_server.c
===================================================================
--- vendor/serf/dist/test/server/test_server.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/server/test_server.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2011 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "apr.h"

Modified: vendor/serf/dist/test/server/test_server.h
===================================================================
--- vendor/serf/dist/test/server/test_server.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/server/test_server.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2011 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef TEST_SERVER_H

Modified: vendor/serf/dist/test/server/test_sslserver.c
===================================================================
--- vendor/serf/dist/test/server/test_sslserver.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/server/test_sslserver.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2013 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "serf.h"
@@ -22,6 +27,10 @@
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
+#define USE_OPENSSL_1_1_API
+#endif
+
 static int init_done = 0;
 
 typedef struct ssl_context_t {
@@ -30,6 +39,7 @@
     SSL_CTX* ctx;
     SSL* ssl;
     BIO *bio;
+    BIO_METHOD *biom;
 
 } ssl_context_t;
 
@@ -40,12 +50,36 @@
     return strlen(buf);
 }
 
+static void bio_set_data(BIO *bio, void *data)
+{
+#ifdef USE_OPENSSL_1_1_API
+    BIO_set_data(bio, data);
+#else
+    bio->ptr = data;
+#endif
+}
+
+static void *bio_get_data(BIO *bio)
+{
+#ifdef USE_OPENSSL_1_1_API
+    return BIO_get_data(bio);
+#else
+    return bio->ptr;
+#endif
+}
+
 static int bio_apr_socket_create(BIO *bio)
 {
+#ifdef USE_OPENSSL_1_1_API
+    BIO_set_shutdown(bio, 1);
+    BIO_set_init(bio, 1);
+    BIO_set_data(bio, NULL);
+#else
     bio->shutdown = 1;
     bio->init = 1;
     bio->num = -1;
     bio->ptr = NULL;
+#endif
 
     return 1;
 }
@@ -83,7 +117,7 @@
 static int bio_apr_socket_read(BIO *bio, char *in, int inlen)
 {
     apr_size_t len = inlen;
-    serv_ctx_t *serv_ctx = bio->ptr;
+    serv_ctx_t *serv_ctx = bio_get_data(bio);
     apr_status_t status;
 
     BIO_clear_retry_flags(bio);
@@ -109,7 +143,7 @@
 static int bio_apr_socket_write(BIO *bio, const char *in, int inlen)
 {
     apr_size_t len = inlen;
-    serv_ctx_t *serv_ctx = bio->ptr;
+    serv_ctx_t *serv_ctx = bio_get_data(bio);
 
     apr_status_t status = apr_socket_send(serv_ctx->client_sock, in, &len);
 
@@ -124,6 +158,7 @@
 }
 
 
+#ifndef USE_OPENSSL_1_1_API
 static BIO_METHOD bio_apr_socket_method = {
     BIO_TYPE_SOCKET,
     "APR sockets",
@@ -138,7 +173,28 @@
     NULL /* sslc does not have the callback_ctrl field */
 #endif
 };
+#endif
 
+static BIO_METHOD *bio_meth_apr_socket_new(void)
+{
+    BIO_METHOD *biom = NULL;
+
+#ifdef USE_OPENSSL_1_1_API
+    biom = BIO_meth_new(BIO_TYPE_SOCKET, "APR sockets");
+    if (biom) {
+        BIO_meth_set_write(biom, bio_apr_socket_write);
+        BIO_meth_set_read(biom, bio_apr_socket_read);
+        BIO_meth_set_ctrl(biom, bio_apr_socket_ctrl);
+        BIO_meth_set_create(biom, bio_apr_socket_create);
+        BIO_meth_set_destroy(biom, bio_apr_socket_destroy);
+    }
+#else
+    biom = &bio_apr_socket_method;
+#endif
+
+    return biom;
+}
+
 static int validate_client_certificate(int preverify_ok, X509_STORE_CTX *ctx)
 {
     serf__log(TEST_VERBOSE, __FILE__, "validate_client_certificate called, "
@@ -172,7 +228,11 @@
     /* Init OpenSSL globally */
     if (!init_done)
     {
+#ifdef USE_OPENSSL_1_1_API
+        OPENSSL_malloc_init();
+#else
         CRYPTO_malloc_init();
+#endif
         ERR_load_crypto_strings();
         SSL_load_error_strings();
         SSL_library_init();
@@ -200,7 +260,7 @@
         certfile = certfiles[0];
         rv = SSL_CTX_use_certificate_file(ssl_ctx->ctx, certfile, SSL_FILETYPE_PEM);
         if (rv != 1) {
-            fprintf(stderr, "Cannot load certficate from file '%s'\n", keyfile);
+            fprintf(stderr, "Cannot load certficate from file '%s'\n", certfile);
             exit(1);
         }
 
@@ -229,8 +289,9 @@
 
         SSL_CTX_set_mode(ssl_ctx->ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
 
-        ssl_ctx->bio = BIO_new(&bio_apr_socket_method);
-        ssl_ctx->bio->ptr = serv_ctx;
+        ssl_ctx->biom = bio_meth_apr_socket_new();
+        ssl_ctx->bio = BIO_new(ssl_ctx->biom);
+        bio_set_data(ssl_ctx->bio, serv_ctx);
         init_ssl(serv_ctx);
     }
 
@@ -383,8 +444,12 @@
     ssl_context_t *ssl_ctx = servctx->ssl_ctx;
 
     if (ssl_ctx) {
-        if (ssl_ctx->ssl)
+        if (ssl_ctx->ssl) {
           SSL_clear(ssl_ctx->ssl);
+#ifdef USE_OPENSSL_1_1_API
+          BIO_meth_free(ssl_ctx->biom);
+#endif
+        }
         SSL_CTX_free(ssl_ctx->ctx);
     }
 

Modified: vendor/serf/dist/test/test_all.c
===================================================================
--- vendor/serf/dist/test/test_all.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_all.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2007 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "apr.h"

Modified: vendor/serf/dist/test/test_auth.c
===================================================================
--- vendor/serf/dist/test/test_auth.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_auth.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2013 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr_strings.h>

Modified: vendor/serf/dist/test/test_buckets.c
===================================================================
--- vendor/serf/dist/test/test_buckets.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_buckets.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2007 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr.h>
@@ -984,6 +989,35 @@
     CuAssert(tc, "Read less data than expected.", strlen(expected) == 0);
 }
 
+/* Test handling responses without a reason by response buckets. */
+static void test_response_bucket_no_reason(CuTest *tc)
+{
+    test_baton_t *tb = tc->testBaton;
+    serf_bucket_t *bkt, *tmp;
+    serf_status_line sline;
+    serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(tb->pool, NULL,
+                                                              NULL);
+
+    tmp = SERF_BUCKET_SIMPLE_STRING("HTTP/1.1 401" CRLF
+                                    "Content-Type: text/plain" CRLF
+                                    "Content-Length: 2" CRLF
+                                    CRLF
+                                    "AB",
+                                    alloc);
+
+    bkt = serf_bucket_response_create(tmp, alloc);
+
+    read_and_check_bucket(tc, bkt, "AB");
+
+    serf_bucket_response_status(bkt, &sline);
+    CuAssertTrue(tc, sline.version == SERF_HTTP_11);
+    CuAssertIntEquals(tc, 401, sline.code);
+
+    /* Probably better to have just "Logon failed" as reason. But current
+       behavior is also acceptable.*/
+    CuAssertStrEquals(tc, "", sline.reason);
+}
+
 /* Test that serf can handle lines that don't arrive completely in one go.
    It doesn't really run random, it tries inserting APR_EAGAIN in all possible
    places in the response message, only one currently. */
@@ -1232,9 +1266,9 @@
 
     /* The largest buffer we should need is 0.1% larger than the
        uncompressed data, + 12 bytes. This info comes from zlib.h.
+       buf_size = orig_len + (orig_len / 1000) + 12;
        Note: This isn't sufficient when using Z_NO_FLUSH and extremely compressed
        data. Use a buffer bigger than what we need. */
-//    buf_size = orig_len + (orig_len / 1000) + 12;
     buf_size = 100000;
 
     write_buf = apr_palloc(pool, buf_size);
@@ -1309,12 +1343,12 @@
                           expected_len);
 }
 
-static void deflate_buckets(CuTest *tc, int nr_of_loops)
+static void deflate_buckets(CuTest *tc, int nr_of_loops, apr_pool_t *pool)
 {
     const char *msg = "12345678901234567890123456789012345678901234567890";
 
     test_baton_t *tb = tc->testBaton;
-    serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(tb->pool, NULL,
+    serf_bucket_alloc_t *alloc = serf_bucket_allocator_create(pool, NULL,
                                                               NULL);
     z_stream zdestr;
     int i;
@@ -1333,8 +1367,8 @@
     {
         serf_config_t *config;
 
-        serf_context_t *ctx = serf_context_create(tb->pool);
-        /* status = */ serf__config_store_get_config(ctx, NULL, &config, tb->pool);
+        serf_context_t *ctx = serf_context_create(pool);
+        /* status = */ serf__config_store_get_config(ctx, NULL, &config, pool);
 
         serf_bucket_set_config(defbkt, config);
     }
@@ -1350,17 +1384,17 @@
     serf_bucket_aggregate_append(aggbkt, strbkt);
 
     for (i = 0; i < nr_of_loops; i++) {
-        const char *data;
-        apr_size_t len;
+        const char *data = NULL;
+        apr_size_t len = 0;
 
         if (i == nr_of_loops - 1) {
             CuAssertIntEquals(tc, APR_SUCCESS,
                               deflate_compress(&data, &len, &zdestr, msg,
-                                               strlen(msg), 1, tb->pool));
+                                               strlen(msg), 1, pool));
         } else {
             CuAssertIntEquals(tc, APR_SUCCESS,
                               deflate_compress(&data, &len, &zdestr, msg,
-                                               strlen(msg), 0, tb->pool));
+                                               strlen(msg), 0, pool));
         }
 
         if (len == 0)
@@ -1378,10 +1412,15 @@
 static void test_deflate_buckets(CuTest *tc)
 {
     int i;
+    apr_pool_t *iterpool;
+    test_baton_t *tb = tc->testBaton;
 
+    apr_pool_create(&iterpool, tb->pool);
     for (i = 1; i < 1000; i++) {
-        deflate_buckets(tc, i);
+        apr_pool_clear(iterpool);
+        deflate_buckets(tc, i, iterpool);
     }
+    apr_pool_destroy(iterpool);
 }
 
 static apr_status_t discard_data(serf_bucket_t *bkt,
@@ -1430,9 +1469,6 @@
     serf_bucket_t *defbkt = serf_bucket_deflate_create(stream, alloc,
                                                        SERF_DEFLATE_GZIP);
     int zerr;
-
-    memset(outzstr, 0, sizeof(z_stream));
-
     const char gzip_header[10] =
     { '\037', '\213', Z_DEFLATED, 0,
         0, 0, 0, 0, /* mtime */
@@ -1439,9 +1475,11 @@
         0, 0x03 /* Unix OS_CODE */
     };
 
+    memset(outzstr, 0, sizeof(z_stream));
+
     /* HTTP uses raw deflate format, so windows size => -15 */
     zerr = deflateInit2(outzstr, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, 8,
-                            Z_DEFAULT_STRATEGY);
+                        Z_DEFAULT_STRATEGY);
     if (zerr != Z_OK)
         return NULL;
 
@@ -1556,7 +1594,7 @@
             break;
     }
 
-    CuAssertIntEquals(tc, NR_OF_LOOPS * BUFSIZE, actual_size);
+    CuAssertTrue(tc, actual_size == (apr_size_t)NR_OF_LOOPS * BUFSIZE);
 #undef NR_OF_LOOPS
 #undef BUFSIZE
 }
@@ -1577,6 +1615,7 @@
     SUITE_ADD_TEST(suite, test_response_body_chunked_incomplete_crlf);
     SUITE_ADD_TEST(suite, test_response_body_chunked_gzip_small);
     SUITE_ADD_TEST(suite, test_response_bucket_peek_at_headers);
+    SUITE_ADD_TEST(suite, test_response_bucket_no_reason);
     SUITE_ADD_TEST(suite, test_bucket_header_set);
     SUITE_ADD_TEST(suite, test_iovec_buckets);
     SUITE_ADD_TEST(suite, test_aggregate_buckets);

Modified: vendor/serf/dist/test/test_context.c
===================================================================
--- vendor/serf/dist/test/test_context.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_context.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2007 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <stdlib.h>
@@ -1016,6 +1021,22 @@
     "test/server/serfrootcacert.pem",
     NULL };
 
+static const char **server_certs_srcdir(const char **certs,
+                                         apr_pool_t *result_pool)
+{
+  const char **result;
+  int i = 0;
+  while (certs[i])
+    i++;
+
+  result = apr_pcalloc(result_pool, sizeof(result[0]) * (i + 1));
+
+  while (i-- > 0)
+    result[i] = get_srcdir_file(result_pool, certs[i]);
+
+  return result;
+}
+
 static apr_status_t validate_servercert(const serf_ssl_certificate_t *cert,
                                         apr_pool_t *pool)
 {
@@ -1170,8 +1191,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      NULL, /* default conn setup */
-                                     "test/server/serfserverkey.pem",
-                                     server_cert,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_cert, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_failures,
                                      test_pool);
@@ -1208,7 +1229,8 @@
         return status;
 
     status = serf_ssl_load_cert_file(&rootcacert,
-                                     "test/server/serfrootcacert.pem",
+                                     get_srcdir_file(pool,
+                                               "test/server/serfrootcacert.pem"),
                                      pool);
     if (status)
         return status;
@@ -1241,8 +1263,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      https_set_root_ca_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_allok,
                                      test_pool);
@@ -1278,8 +1300,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      https_set_root_ca_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_reject,
                                      test_pool);
@@ -1375,8 +1397,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      chain_rootca_callback_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_allok,
                                      test_pool);
@@ -1450,8 +1472,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      chain_callback_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     all_server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(all_server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_allok,
                                      test_pool);
@@ -1488,8 +1510,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      https_set_root_ca_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      NULL, /* No server cert callback */
                                      test_pool);
@@ -1523,8 +1545,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      NULL, /* default conn setup, no certs */
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      NULL, /* No server cert callback */
                                      test_pool);
@@ -1559,8 +1581,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      https_set_root_ca_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      NULL, /* No server cert callback */
                                      test_pool);
@@ -1598,8 +1620,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      https_set_root_ca_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(server_certs, test_pool),
                                      NULL, /* no client cert */
                                      NULL, /* No server cert callback */
                                      test_pool);
@@ -1622,7 +1644,7 @@
 
     tb->result_flags |= TEST_RESULT_CLIENT_CERTCB_CALLED;
 
-    *cert_path = "test/server/serfclientcert.p12";
+    *cert_path = get_srcdir_file(tb->pool, "test/server/serfclientcert.p12");
 
     return APR_SUCCESS;
 }
@@ -1634,8 +1656,8 @@
     test_baton_t *tb = data;
 
     tb->result_flags |= TEST_RESULT_CLIENT_CERTPWCB_CALLED;
-    
-    if (strcmp(cert_path, "test/server/serfclientcert.p12") == 0)
+    if (strcmp(cert_path,
+               get_srcdir_file(tb->pool, "test/server/serfclientcert.p12")) == 0)
     {
         *password = "serftest";
         return APR_SUCCESS;
@@ -1694,8 +1716,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      client_cert_conn_setup,
-                                     "test/server/serfserverkey.pem",
-                                     all_server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(all_server_certs, test_pool),
                                      "Serf Client",
                                      NULL, /* No server cert callback */
                                      test_pool);
@@ -1739,8 +1761,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      NULL, /* default conn setup */
-                                     "test/server/serfserverkey.pem",
-                                     expired_server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(expired_server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_failures,
                                      test_pool);
@@ -1785,8 +1807,8 @@
                                      message_list, num_requests,
                                      action_list, num_requests, 0,
                                      NULL, /* default conn setup */
-                                     "test/server/serfserverkey.pem",
-                                     future_server_certs,
+                                     get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                     server_certs_srcdir(future_server_certs, test_pool),
                                      NULL, /* no client cert */
                                      ssl_server_cert_cb_expect_failures,
                                      test_pool);
@@ -1852,8 +1874,8 @@
                                            action_list_proxy, 2,
                                            0,
                                            https_set_root_ca_conn_setup,
-                                           "test/server/serfserverkey.pem",
-                                           server_certs,
+                                           get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                           server_certs_srcdir(server_certs, test_pool),
                                            NULL, /* no client cert */
                                            NULL, /* No server cert callback */
                                            test_pool);
@@ -1913,8 +1935,8 @@
                                            action_list_proxy, 1,
                                            0,
                                            https_set_root_ca_conn_setup,
-                                           "test/server/serfserverkey.pem",
-                                           server_certs,
+                                           get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                           server_certs_srcdir(server_certs, test_pool),
                                            NULL, /* no client cert */
                                            NULL, /* No server cert callback */
                                            test_pool);
@@ -2093,8 +2115,8 @@
                                            action_list_proxy, 7,
                                            0,
                                            https_set_root_ca_conn_setup,
-                                           "test/server/serfserverkey.pem",
-                                           server_certs,
+                                           get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                           server_certs_srcdir(server_certs, test_pool),
                                            NULL, /* no client cert */
                                            NULL, /* No server cert callback */
                                            test_pool);
@@ -2242,8 +2264,8 @@
                                            action_list_proxy, 3,
                                            0,
                                            https_set_root_ca_conn_setup,
-                                           "test/server/serfserverkey.pem",
-                                           server_certs,
+                                           get_srcdir_file(test_pool, "test/server/serfserverkey.pem"),
+                                           server_certs_srcdir(server_certs, test_pool),
                                            NULL, /* no client cert */
                                            NULL, /* No server cert callback */
                                            test_pool);

Modified: vendor/serf/dist/test/test_serf.h
===================================================================
--- vendor/serf/dist/test/test_serf.h	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_serf.h	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2002-2007 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #ifndef TEST_SERF_H
@@ -282,4 +287,8 @@
                                        serf_bucket_alloc_t *allocator);
 apr_status_t serf_bucket_mock_more_data_arrived(serf_bucket_t *bucket);
 
+/* Helper to get a file relative to our source directory by looking at
+ * 'srcdir' env variable. */
+const char * get_srcdir_file(apr_pool_t *pool, const char * file);
+
 #endif /* TEST_SERF_H */

Modified: vendor/serf/dist/test/test_ssl.c
===================================================================
--- vendor/serf/dist/test/test_ssl.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_ssl.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,16 +1,21 @@
-/* Copyright 2008 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include <apr.h>
@@ -54,20 +59,7 @@
     CuAssertIntEquals(tc, APR_SUCCESS, status);
 }
 
-
-static const char * get_ca_file(apr_pool_t *pool, const char * file)
-{
-    char *srcdir = "";
-
-    if (apr_env_get(&srcdir, "srcdir", pool) == APR_SUCCESS) {
-        return apr_pstrcat(pool, srcdir, "/", file, NULL);
-    }
-    else {
-        return file;
-    }
-}
-
-
+#define get_ca_file(pool, file)  get_srcdir_file(pool, file) 
 /* Test that loading a custom CA certificate file works. */
 static void test_ssl_load_cert_file(CuTest *tc)
 {
@@ -261,7 +253,8 @@
 
     /* A .pem file contains a Base64 encoded DER certificate, which is exactly
        what serf_ssl_cert_export is supposed to be returning. */
-    status = apr_file_open(&fp, "test/serftestca.pem",
+    status = apr_file_open(&fp,
+                           get_srcdir_file(test_pool, "test/serftestca.pem"),
                            APR_FOPEN_READ | APR_FOPEN_BINARY,
                            APR_FPROT_OS_DEFAULT, test_pool);
     CuAssertIntEquals(tc, APR_SUCCESS, status);

Modified: vendor/serf/dist/test/test_util.c
===================================================================
--- vendor/serf/dist/test/test_util.c	2017-02-20 02:08:13 UTC (rev 9258)
+++ vendor/serf/dist/test/test_util.c	2017-02-20 02:14:38 UTC (rev 9259)
@@ -1,20 +1,26 @@
-/* Copyright 2002-2007 Justin Erenkrantz and Greg Stein
+/* ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
  */
 
 #include "apr.h"
 #include "apr_pools.h"
+#include <apr_env.h>
 #include <apr_strings.h>
 
 #include <stdlib.h>
@@ -32,6 +38,18 @@
 #define HTTP_SERV_URL  "http://localhost:" SERV_PORT_STR
 #define HTTPS_SERV_URL "https://localhost:" SERV_PORT_STR
 
+const char * get_srcdir_file(apr_pool_t *pool, const char * file)
+{
+    char *srcdir = "";
+
+    if (apr_env_get(&srcdir, "srcdir", pool) == APR_SUCCESS) {
+        return apr_pstrcat(pool, srcdir, "/", file, NULL);
+    }
+    else {
+        return file;
+    }
+}
+
 /* cleanup for conn */
 static apr_status_t cleanup_conn(void *baton)
 {



More information about the Midnightbsd-cvs mailing list