- 17 Oct, 2021 1 commit
-
-
libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
Edward Thomson committed
-
- 27 Nov, 2020 1 commit
-
-
Edward Thomson committed
-
- 11 Oct, 2020 1 commit
-
-
Provide a mechanism for system components to register for initialization and shutdown of the libgit2 runtime.
Edward Thomson committed
-
- 24 Jan, 2020 1 commit
-
-
Move the redirect handling into `git_net_url` for consistency.
Edward Thomson committed
-
- 09 Jan, 2020 1 commit
-
-
Some servers leave the query parameters intact in the Location header when responding with a redirect. The service_suffix removal check as written assumed that the server removed them. Handle both cases. Along with PR #5325, this fixes #5321. There are two new tests. The first already passed; the second previously failed.
Josh Bleecher Snyder committed
-
- 24 Jun, 2019 1 commit
-
-
Only read at most INT_MAX from the underlying stream, so that we can accurately return the number of bytes read. Since callers are not guaranteed to get as many bytes as requested (due to availability of input), this is safe and callers should call in a loop until EOF.
Edward Thomson committed
-
- 10 Jun, 2019 1 commit
-
-
"Connection data" is an imprecise and largely incorrect name; these structures are actually parsed URLs. Provide a parser that takes a URL string and produces a URL structure (if it is valid). Separate the HTTP redirect handling logic from URL parsing, keeping a `gitno_connection_data_handle_redirect` whose only job is redirect handling logic and does not parse URLs itself.
Edward Thomson committed
-
- 22 Jan, 2019 1 commit
-
-
Move to the `git_error` name in the internal API for error-related functions.
Edward Thomson committed
-
- 09 Nov, 2018 1 commit
-
-
Constant strings and logic for HTTP(S) default ports were starting to be spread throughout netops.c. Instead of duplicating this again to determine if a Host header should include the port, move the default port constants and logic into an internal method in netops.{c,h}.
Rick Altherr committed
-
- 10 Jun, 2018 1 commit
-
-
Patrick Steinhardt committed
-
- 19 Mar, 2018 4 commits
-
-
RFC 3986 says that hostnames can be percent encoded. Percent decode hostnames in our URLs.
Edward Thomson committed -
Edward Thomson committed
-
Now that we can decode percent-encoded strings as part of `git_buf`s, use that decoder in `gitno_extract_url_parts`.
Edward Thomson committed -
Steven King Jr committed
-
- 03 Jul, 2017 1 commit
-
-
Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
Patrick Steinhardt committed
-
- 29 Dec, 2016 1 commit
-
-
Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
Edward Thomson committed
-
- 19 Apr, 2016 1 commit
-
-
When we're dealing with proxy addresses, we only want a hostname and port, and the user would not provide a path, so make it optional so we can use this same function to parse git as well as proxy URLs.
Carlos Martín Nieto committed
-
- 18 Feb, 2016 1 commit
-
-
Patrick Steinhardt committed
-
- 29 May, 2015 1 commit
-
-
Some brain damaged tolower() implementations appear to want to take the locale into account, and this may require taking some insanely aggressive lock on the locale and slowing down what should be the most trivial of trivial calls for people who just want to downcase ASCII.
Edward Thomson committed
-
- 10 Dec, 2014 2 commits
-
-
Most of the network-facing facilities have been copied to the socket and openssl streams. No code now uses these functions directly anymore, so we can now remove them.
Carlos Martín Nieto committed -
Carlos Martín Nieto committed
-
- 02 Nov, 2014 1 commit
-
-
When we first ask OpenSSL to verify the certfiicate itself (rather than the HTTPS specifics), we should also return GIT_ECERTIFICATE. Otherwise, the caller would consider this as a failed operation rather than a failed validation and not call the user's own validation.
Carlos Martín Nieto committed
-
- 24 Sep, 2014 1 commit
-
-
The getaddrinfo function indicates failure with a non-zero return code, but this code is not necessarily negative. On platforms like Android where the code is positive, a failed call causes libgit2 to segfault.
William Swanson committed
-
- 16 Sep, 2014 2 commits
-
-
This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
Carlos Martín Nieto committed -
If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
Carlos Martín Nieto committed
-
- 06 Jul, 2014 1 commit
-
-
Jacques Germishuys committed
-
- 03 Jul, 2014 1 commit
-
-
In order to connect to a remote server, we need to provide a path to the repository we're interested in. Consider the lack of path in the url an error.
Carlos Martín Nieto committed
-
- 12 Jun, 2014 2 commits
-
-
Bring together all of the OpenSSL initialization to git_threads_init() so it's together and doesn't need locks. Moving it here also gives us libssh2 thread safety (when built against openssl).
Carlos Martín Nieto committed -
OpenSSL's tests init everything in the main thread, so let's do that.
Carlos Martín Nieto committed
-
- 11 Jun, 2014 2 commits
-
-
When using in a multithreaded context, OpenSSL needs to lock, and leaves it up to application to provide said locks. We were not doing this, and it's just luck that's kept us from crashing up to now.
Carlos Martín Nieto committed -
The OpenSSL init functions are not reentrant, which means that running multiple fetches in parallel can cause us to crash. Use a mutex to init OpenSSL, and since we're adding this extra checks, init it only once.
Carlos Martín Nieto committed
-
- 13 May, 2014 1 commit
-
-
The code doesn't use SSL and a test requires it.
Albert Meltzer committed
-
- 26 Apr, 2014 3 commits
-
-
It's possible for an encrypted connection not have a certificate. In this case, SSL_get_verify_result() will return OK because no error happened (as it never even tried to validate anything). SSL_get_peer_certificate() will return NULL in this case so we need to catch that. On the upside, the current code would segfault in this situation instead of letting it through as a valid cert.
Carlos Martín Nieto committed -
Specify what we do not like about the certificate. In this case, we do not like the name.
Carlos Martín Nieto committed -
This kind of stuff should have unit tests, even if it's just to show what we expect to match successfully.
Carlos Martín Nieto committed
-
- 18 Nov, 2013 1 commit
-
-
Carlos Martín Nieto committed
-
- 13 Nov, 2013 1 commit
-
-
Russell Belfer committed
-
- 12 Nov, 2013 1 commit
-
-
Linquize committed
-
- 05 Nov, 2013 2 commits
-
-
Ben Straub committed
-
Ben Straub committed
-