summaryrefslogtreecommitdiff
path: root/src/net.h
Commit message (Collapse)AuthorAgeFilesLines
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* url: introduce `git_net_url_dup`Edward Thomson2021-09-011-0/+3
|
* url: introduce `git_net_url_matches_pattern_list`Edward Thomson2021-09-011-0/+3
| | | | | | Provide a utility method on a url to determine if it matches any pattern in a comma-separated list, similar to what one would find in `NO_PROXY` environment variables.
* url: introduce `git_net_url_matches_pattern`Edward Thomson2021-09-011-0/+5
| | | | | Provide a method to determine if a given URL matches a host:port pattern like the ones found in `NO_PROXY` environment variables.
* net: function to identify ipv6 addresses in URLsEdward Thomson2020-12-231-0/+3
|
* net: is_default_port is a boolEdward Thomson2020-12-231-2/+2
|
* net: introduce path formatting functionEdward Thomson2020-01-241-0/+3
| | | | | Introduce a function to format the path and query string for a URL, suitable for creating an HTTP request.
* net: introduce url formatting functionEdward Thomson2020-01-241-0/+3
|
* net: introduce git_net_url_joinpathEdward Thomson2020-01-241-0/+6
| | | | | | Provide a mechanism to add a path and query string to an existing url so that we can easily append `/info/refs?...` type url segments to a url given to us by a user.
* net: refactor gitno redirect handlingEdward Thomson2020-01-241-0/+6
| | | | Move the redirect handling into `git_net_url` for consistency.
* net: add an isvalid functionEdward Thomson2020-01-241-4/+7
| | | | (Also, mark all the declarations as extern.)
* net: rename gitno_connection_data to git_net_urlEdward Thomson2019-06-101-0/+36
"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.