1. 13 May, 2023 2 commits
    • streams: sockets are non-blocking and can timeout · fad90428
      Make socket I/O non-blocking and add optional timeouts.
      
      Users may now set `GIT_OPT_SET_SERVER_CONNECT_TIMEOUT` to set a shorter
      connection timeout. (The connect timeout cannot be longer than the
      operating system default.) Users may also now configure the socket read
      and write timeouts with `GIT_OPT_SET_SERVER_TIMEOUT`.
      
      By default, connects still timeout based on the operating system
      defaults (typically 75 seconds) and socket read and writes block.
      
      Add a test against our custom testing git server that ensures that we
      can timeout reads against a slow server.
      Edward Thomson committed
  2. 21 Mar, 2023 1 commit
    • http: introduce schannel streams for windows · f68f542e
      Provide a stream interface for Schannel - the native crypto APIs - on
      Windows. This allows Windows to use the same HTTP transport that all the
      other platforms use, with its own native crypto.
      
      Ultimately this allows us to deprecate WinHTTP and we need not add
      support for our socket changes in two places (our HTTP stack and the
      WinHTTP stack).
      Edward Thomson committed
  3. 27 Feb, 2023 1 commit
  4. 24 Feb, 2023 1 commit
  5. 12 Feb, 2023 1 commit
  6. 09 Feb, 2023 1 commit
  7. 19 Sep, 2022 2 commits
  8. 22 Jul, 2022 1 commit
  9. 14 Jul, 2022 2 commits
  10. 20 Jun, 2022 1 commit
  11. 15 Jun, 2022 1 commit
  12. 23 Mar, 2022 1 commit
  13. 23 Feb, 2022 1 commit
  14. 13 Jan, 2022 1 commit
  15. 11 Nov, 2021 1 commit
  16. 09 Nov, 2021 1 commit
  17. 17 Oct, 2021 1 commit
    • str: introduce `git_str` for internal, `git_buf` is external · f0e693b1
      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
  18. 02 Sep, 2021 2 commits
  19. 30 Aug, 2021 1 commit
  20. 01 Mar, 2021 1 commit
  21. 06 Oct, 2020 1 commit
  22. 01 Jun, 2020 1 commit
  23. 07 Feb, 2020 1 commit
    • transports: http: fix custom headers not being applied · 46228d86
      In commit b9c5b15a (http: use the new httpclient, 2019-12-22), the HTTP
      code got refactored to extract a generic HTTP client that operates
      independently of the Git protocol. Part of refactoring was the creation
      of a new `git_http_request` struct that encapsulates the generation of
      requests. Our Git-specific HTTP transport was converted to use that in
      `generate_request`, but during the process we forgot to set up custom
      headers for the `git_http_request` and as a result we do not send out
      these headers anymore.
      
      Fix the issue by correctly setting up the request's custom headers and
      add a test to verify we correctly send them.
      Patrick Steinhardt committed
  24. 26 Jan, 2020 1 commit
    • credential: change git_cred to git_credential · 3f54ba8b
      We avoid abbreviations where possible; rename git_cred to
      git_credential.
      
      In addition, we have standardized on a trailing `_t` for enum types,
      instead of using "type" in the name.  So `git_credtype_t` has become
      `git_credential_t` and its members have become `GIT_CREDENTIAL` instead
      of `GIT_CREDTYPE`.
      
      Finally, the source and header files have been renamed to `credential`
      instead of `cred`.
      
      Keep previous name and values as deprecated, and include the new header
      files from the previous ones.
      Edward Thomson committed
  25. 24 Jan, 2020 2 commits
  26. 24 Nov, 2019 1 commit
    • test: add an azure repos test · 0005c77a
      We currently talk to Azure Repos for executing an online test
      (online::clone::path_whitespace).  Add a simpler test to talk to Azure
      Repos to make it obvious that strange test failures are not likely the
      whitespace in the path, but actually a function of talking to Azure
      Repos itself.
      Edward Thomson committed
  27. 13 Aug, 2019 1 commit
  28. 12 Aug, 2019 1 commit
  29. 25 Jul, 2019 1 commit
  30. 24 Jul, 2019 1 commit
  31. 20 Jul, 2019 1 commit
  32. 10 Jun, 2019 2 commits
    • winhttp: support default credentials for proxies · 3d11b6c5
      We did not properly support default credentials for proxies, only for
      destination servers.  Refactor the credential handling to support sending
      either username/password _or_ default credentials to either the proxy or
      the destination server.
      
      This actually shares the authentication logic between proxy servers and
      destination servers.  Due to copy/pasta drift over time, they had
      diverged.  Now they share a common logic which is: first, use
      credentials specified in the URL (if there were any), treating empty
      username and password (ie, "http://:@foo.com/") as default credentials,
      for compatibility with git.  Next, call the credential callbacks.
      Finally, fallback to WinHTTP compatibility layers using built-in
      authentication like we always have.
      
      Allowing default credentials for proxies requires moving the security
      level downgrade into the credential setting routines themselves.
      We will update our security level to "high" by default which means that
      we will never send default credentials without prompting.  (A lower
      setting, like the WinHTTP default of "medium" would allow WinHTTP to
      handle credentials for us, despite what a user may have requested with
      their structures.)  Now we start with "high" and downgrade to "low" only
      after a user has explicitly requested default credentials.
      Edward Thomson committed
    • network: don't add arbitrary url rules · 757411a0
      There's no reason a git repository couldn't be at the root of a server,
      and URLs should have an implicit path of '/' when one is not specified.
      Edward Thomson committed
  33. 05 Jun, 2019 1 commit
    • online tests: use gitlab for auth failures · e66a4eb3
      GitHub recently changed their behavior from returning 401s for private
      or nonexistent repositories on a clone to returning 404s.  For our tests
      that require an auth failure (and 401), move to GitLab to request a
      missing repository.  This lets us continue to test our auth failure
      case, at least until they decide to mimic that decision.
      Edward Thomson committed
  34. 22 Feb, 2019 1 commit