1. 27 Nov, 2020 1 commit
  2. 31 Jan, 2019 1 commit
    • streams: fix callers potentially only writing partial data · 5265b31c
      Similar to the write(3) function, implementations of `git_stream_write`
      do not guarantee that all bytes are written. Instead, they return the
      number of bytes that actually have been written, which may be smaller
      than the total number of bytes. Furthermore, due to an interface design
      issue, we cannot ever write more than `SSIZE_MAX` bytes at once, as
      otherwise we cannot represent the number of bytes written to the caller.
      
      Unfortunately, no caller of `git_stream_write` ever checks the return
      value, except to verify that no error occurred. Due to this, they are
      susceptible to the case where only partial data has been written.
      
      Fix this by introducing a new function `git_stream__write_full`. In
      contrast to `git_stream_write`, it will always return either success or
      failure, without returning the number of bytes written. Thus, it is able
      to write all `SIZE_MAX` bytes and loop around `git_stream_write` until
      all data has been written. Adjust all callers except the BIO callbacks
      in our mbedtls and OpenSSL streams, which already do the right thing and
      require the amount of bytes written.
      Patrick Steinhardt committed
  3. 25 Jan, 2019 1 commit
    • streams: don't write more than SSIZE_MAX · f1986a23
      Our streams implementation takes a `size_t` that indicates the length of
      the data buffer to be written, and returns an `ssize_t` that indicates
      the length that _was_ written.  Clearly no such implementation can write
      more than `SSIZE_MAX` bytes.  Ensure that each TLS stream implementation
      does not try to write more than `SSIZE_MAX` bytes (or smaller; if the
      given implementation takes a smaller size).
      Edward Thomson committed
  4. 22 Jan, 2019 1 commit
  5. 28 Nov, 2018 2 commits
    • http: remove cURL · 21142c5a
      We previously used cURL to support HTTP proxies.  Now that we've added
      this support natively, we can remove the curl dependency.
      Edward Thomson committed
    • tls: introduce a wrap function · 43b592ac
      Introduce `git_tls_stream_wrap` which will take an existing `stream`
      with an already connected socket and begin speaking TLS on top of it.
      This is useful if you've built a connection to a proxy server and you
      wish to begin CONNECT over it to tunnel a TLS connection.
      
      Also update the pluggable TLS stream layer so that it can accept a
      registration structure that provides an `init` and `wrap` function,
      instead of a single initialization function.
      Edward Thomson committed
  6. 25 Sep, 2018 1 commit
  7. 14 Dec, 2017 1 commit
  8. 23 Oct, 2017 1 commit
  9. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      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
  10. 09 Aug, 2016 1 commit
  11. 08 Aug, 2016 1 commit
  12. 05 Aug, 2016 1 commit
  13. 06 May, 2016 1 commit
  14. 21 Apr, 2016 1 commit
  15. 10 Jul, 2015 1 commit
  16. 26 Jun, 2015 1 commit
  17. 24 Jun, 2015 1 commit
  18. 15 Jun, 2015 1 commit
  19. 12 Jun, 2015 1 commit
  20. 23 Apr, 2015 4 commits