Commit Graph

65 Commits

Author SHA1 Message Date
Josh Bleecher Snyder
93def7ad64 ntlm: prevent (spurious) compiler warnings
Pull in commit

e7b2583e1b

to fix #5353.
2020-01-09 13:37:18 -08:00
Jason Haslam
7218cf47e1 ntlm: fix failure to find openssl headers 2019-08-29 15:03:46 -06:00
Edward Thomson
9f3441ccf5 zlib: remove unused functions 2019-06-24 17:27:23 +01:00
Edward Thomson
b292c35fef http_parser: cast pointer arithmetic safely 2019-06-24 15:00:40 +01:00
Patrick Steinhardt
358b7a9d1d deps: ntlmclient: disable implicit fallthrough warnings
The ntlmclient dependency has quite a lot of places with implicit
fallthroughs. As at least modern GCC has enabled warnings on
implicit fallthroughs by default, the developer is greeted with a
wall of warnings when compiling that dependency.

Disable implicit fallthrough warnings for ntlmclient to fix this
issue.
2019-06-14 08:44:13 +02:00
Edward Thomson
1bbdec69be http_parser: handle URLs with colon but no port
When the end of the host is reached, and we're at the colon separating
the host with the port (ie, there is no numeric port) then do not error.
This is allowed by RFC 3986.
2019-06-11 21:55:31 +01:00
Edward Thomson
a7f65f03bd ntlm: add ntlmclient as a dependency
Include https://github.com/ethomson/ntlmclient as a dependency.
2019-06-10 19:58:22 +01:00
Edward Thomson
1f9b72225d cmake: disable fallthrough warnings for PCRE
Our PCRE dependency has uncommented fallthroughs in switch statements.
Turn off warnings for those in the PCRE code.
2019-05-22 12:47:04 +02:00
Edward Thomson
e4b2ef87c7 regex: don't warn on unused functions
PCRE includes compatibility functions that may go unused.  Don't warn.
2019-05-19 11:12:13 +01:00
Edward Thomson
9ceafb57b2 regexec: use pcre as our fallback/builtin regex
Use PCRE 8.42 as the builtin regex implementation, using its POSIX
compatibility layer.  PCRE uses ASCII by default and the users locale
will not influence its behavior, so its `regcomp` implementation is
similar to `regcomp_l` with a C locale.
2019-05-19 11:12:13 +01:00
lhchavez
b5e8272fdc Attempt at fixing the MingW64 compilation
It seems like MingW64's size_t is defined differently than in Linux.
2019-01-06 08:29:56 -08:00
Patrick Steinhardt
2e0f926e1c docs: clarify and include licenses of dependencies
While our contribution guide tries to make clear the licenses that apply
to libgit2, it does not make clear that different licenses apply to our
bundled dependencies. Make this clear by listing each dependency
together with the licenses that they are governed by. Furthermore,
bundle the complete license texts next to the code they apply to.
2018-08-30 12:16:59 +02:00
Patrick Steinhardt
cacbf99889 deps: fix implicit fallthrough warning in http-parser
GCC 7 has introduced new warnings for implicit fallthrough in switch
statements. Whenever there is no branch in a case block, GCC will watch
out for some heuristics which indicate that the implicit fallthrough is
intended, like a "fallthrough" comment. The third-party http-parser code
manages to trick this heuristic in one case, even though there is a
"FALLTHROUGH" comment. Fortunately, GCC has also added a strictness
level to the -Wimplicit-fallthrough diagnostic, such that we can loosen
this heuristic and make it more lax.

Set -Wimplicit-fallthrough=1 in http-parser's CMake build instructions,
which is the strictest level that gets rid of the warning. This level
will treat any kind of comment as a "fallthrough" comment, which
silences the warning.
2018-06-22 13:48:55 +02:00
Patrick Steinhardt
4c5330cb83 deps: upgrade embedded zlib to version 1.2.11
The current version of zlib bundled with libgit2 is version 1.2.8. This
version has several CVEs assigned:

- CVE-2016-9843
- CVE-2016-9841
- CVE-2016-9842
- CVE-2016-9840

Upgrade the bundled version to the current release 1.2.11, which has
these vulnerabilities fixes.
2018-03-07 10:33:41 +00:00
Edward Thomson
8c8db98078 mingw: update TLS option flags
Include the constants for `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1` and
`WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2` so that they can be used by mingw.

This updates both the `deps/winhttp` framework (for classic mingw) and
adds the defines for mingw64, which does not use that framework.
2018-02-27 11:22:34 +00:00
Patrick Steinhardt
4da74c83e4 cmake: use project-relative binary and source directories
Due to our split of CMake files into multiple modules, we had to replace
some uses of the `${CMAKE_CURRENT_SOURCE_DIR}` and
`${CMAKE_CURRENT_BINARY_DIR}` variables and replace them with
`${CMAKE_SOURCE_DIR}` and `${CMAKE_BINARY_DIR}`. This enabled us to
still be able to refer to top-level files when defining build
instructions inside of a subdirectory.

When replacing all variables, it was assumed that the absolute set of
variables is always relative to the current project. But in fact, this
is not the case, as these variables always point to the source and
binary directory as given by the top-levl project. So the change
actually broke the ability to include libgit2 directly as a subproject,
as source files cannot be found anymore.

Fix this by instead using project-specific source and binary directories
with `${libgit2_SOURCE_DIR}` and `${libgit2_BINARY_DIR}`.
2017-10-20 07:38:34 +02:00
Patrick Steinhardt
8c19969a88 cmake: fix static linking for bundled deps
Our bundled deps are being built as simple static libraries which are
then linked into the libgit2 library via `TARGET_LINK_LIBRARIES`. While
this works for a dynamically built libgit2 library, using this function
to link two static libraries does not have the expected outcome of
merging those static libraries into one big library. This leads to
symbols of our bundled deps being undefined in the resulting libgit2
archive.

As we have bumped our minimum CMake version to 2.8.11, we can now easily
make use of object libraries for our bundled dependencies. So build
instructions are still self-contained inside of the dependency
directories and the resulting object libraries can just be added to the
LIBGIT2_OBJECTS list, which will cause them to be linked into the final
resulting static library. This fixes the issue of undefined symbols.
2017-09-20 15:26:26 +02:00
Patrick Steinhardt
1f43a43dce cmake: move zlib build instructions into subdirectory
Extract code required to build the zlib library into its own
CMakeLists.txt, which is included as required.
2017-08-16 07:12:38 +02:00
Patrick Steinhardt
b751455497 cmake: move http-parser build instructions into subdirectory
Extract code required to build the http-parser library into its own
CMakeLists.txt, which is included as required.
2017-08-16 07:12:38 +02:00
Patrick Steinhardt
9e449e5214 cmake: move regex build instructions into subdirectory
Extract code required to build the regex library into its own
CMakeLists.txt, which is included as required.
2017-08-16 07:12:38 +02:00
Patrick Steinhardt
4324850015 cmake: move winhttp build instructions into subdirectory
Extract code required to build the winhttp library into its own
CMakeLists.txt, which is included as required.
2017-08-16 07:12:38 +02:00
Patrick Steinhardt
9b0482e4d4 zlib: include "git2/types.h" instead of "common.h"
The zlib dependency includes "common.h" inside of the "zconf.h" header
to make available some type declarations like e.g. git_off_t. Including
the "common.h" header does pull in quite a lot of other headers though,
which are not required at all. Instead, we can just include our public
"git2/types.h" header, which is much more limited in its scope but still
provides everything required for "zconf.h".

This fix eases the transition later on to use a separate "features.h"
header instead of defines. As we have to generate the "features.h"
header, we put it in the build directory and add an include directory.
As we are splitting out building of dependencies into subdirectories,
this would mean that the zlib dependency needs to be aware of the parent
project's build directory, which is unfortunate. By including
"git2/types.h", we avoid this problem.
2017-07-03 08:51:47 +00:00
Chris Bargren
0b1e6e42e3 Updating change to http_parser to reflect PR for nodejs/http-parser
The parser now also supports digits, '-' and '.'. https://github.com/nodejs/http-parser/pull/276
2015-12-28 07:40:15 -07:00
Chris Bargren
d900cec96c Updating http parser to accept a + in the schema 2015-12-22 10:38:16 -07:00
Edward Thomson
4f0f2b8473 Correct line endings on winhttp.def 2015-06-10 16:36:38 -04:00
Tony Kelman
547517d7f9 use a different .def file for 64 bit 2015-03-16 14:59:20 -07:00
klutzy
e613e6ebb8 patch so mingw-w64 can build 2015-03-16 13:59:02 -07:00
Philip Kelley
8f426d7dd2 Win32: Enable WinHTTP for MinGW 2015-03-16 12:59:55 -07:00
Carlos Martín Nieto
d43c7bd050 Rever spelling fixes for dependencies
This is not our code and it adds unecessary changes from the upstream
code.
2014-12-05 08:13:43 +01:00
Will Stamper
b874629b2d Spelling fixes 2014-12-04 21:06:59 -06:00
Jacques Germishuys
66d1595436 Solaris doesn't necessarily have stdint.h, use inttypes.h 2014-08-05 19:51:29 +02:00
Carlos Martín Nieto
b42ff7c016 zlib: disable warning 4142 on MSVC
This is about benign redefinition of types. We're not interested in it.
2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
4f8ac2163b zlib: get rid of compress.c and uncompr.c 2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
2bc76050e0 zlib: get rid of gz* 2014-06-11 18:33:55 +02:00
Carlos Martín Nieto
a9185589f9 zlib: add a few missing defines 2014-06-11 18:03:37 +02:00
Carlos Martín Nieto
bb54fad045 Merge branch 'cmn/zlib-update' into cmn/update-zlib 2014-06-11 16:36:34 +02:00
Carlos Martín Nieto
7cead31edd Merge branch 'cmn/zlib-128' into cmn/zlib-update
Conflicts:
	deps/zlib/crc32.c
	deps/zlib/crc32.h
	deps/zlib/zconf.h
2014-06-11 16:36:08 +02:00
Carlos Martín Nieto
4ca2d7e444 Update zlib to 1.2.8 2014-06-11 16:10:00 +02:00
Edward Thomson
5588f07360 Clean up warnings 2013-12-09 11:40:44 -05:00
Arkadiy Shapkin
10c06114cb Several warnings detected by static code analyzer fixed
Implicit type conversion argument of function to size_t type
Suspicious sequence of types castings: size_t -> int -> size_t
Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)'
Unsigned type is never < 0
2013-03-18 03:30:26 +04:00
Vicent Marti
6e237de6d8 regex: Proper define for this thing 2013-01-11 18:19:52 +01:00
Sebastian Bauer
976d9e136f regex: Fixed warnings about unused parameter values.
There are different solutions to the problem. In this change, we
define an UNUSED macro that maps to __attribute__((unused)) when
compiling with gcc. Otherwise it is a NOOP. We apply this macro
in all function headers for each parameter value that is not used
within the function body.

The change is local to regex.
2013-01-11 11:03:48 +01:00
Sebastian Bauer
d2f14df8c1 regex: Fixed several warnings about signed/unsigned conversions. 2013-01-11 11:03:48 +01:00
Martin Woodward
826bc4a81b Remove use of English expletives
Remove words such as fuck, crap, shit etc.
Remove other potentially offensive words from comments.
Tidy up other geopolicital terms in comments.
2012-11-23 13:31:22 +00:00
Vicent Marti
64ac9548aa Bump the builtin http-parser 2012-11-12 15:42:03 -08:00
Carlos Martín Nieto
b13dbb91ea regex: fix sign warnings 2012-02-18 01:32:13 +01:00
Carlos Martín Nieto
1eaecf2f18 regex: The world uses utf-8 2012-02-18 01:31:48 +01:00
Carlos Martín Nieto
4a1ecba6d9 regex: Move the defines to a config header and include it unconditionally 2012-02-18 01:31:43 +01:00
Carlos Martín Nieto
c17b1d0052 Add POSIX regex sources when needed
Windows doesn't support POSIX regex, so we need to include it
ourselves. The sources come from git, which in turn took them from
gawk.
2012-02-17 22:00:17 +01:00
Vicent Marti
dd3fd68266 msvc: Remove superfluous includes 2011-10-05 13:44:27 -07:00