Skip to content
Snippets Groups Projects
  1. Feb 04, 2025
  2. Jan 30, 2025
  3. Dec 31, 2024
  4. Oct 21, 2024
  5. May 21, 2024
    • Ariadne Conill's avatar
      libfetch: remove support for FTP · 41ea8a08
      Ariadne Conill authored
      
      As discussed in #10749, I suggested that we remove FTP support to reduce possible attack surface
      as there are no Alpine mirrors which use FTP.
      
      There are also no known mirrors of any other apk-using distribution which use FTP, so I believe
      we are safe to remove support for FTP-based mirrors in apk-tools 3.
      
      Signed-off-by: default avatarAriadne Conill <ariadne@dereferenced.org>
      41ea8a08
  6. Oct 12, 2023
  7. Apr 24, 2023
  8. Dec 09, 2021
  9. Jul 26, 2021
  10. Jul 16, 2021
  11. Mar 16, 2021
  12. Mar 13, 2021
    • Martin Vahlensieck's avatar
      Use correct port when redirected · 8e993fe9
      Martin Vahlensieck authored and Timo Teräs's avatar Timo Teräs committed
      If server redirects from http to https, libfetch detects this, but
      wrongly uses the old url scheme to determine the port. This subsequently
      leads to the following OpenSSL error:
      
      139741541575496:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:331:
      
      Using the new scheme fixes this.  This error message comes from trying
      to connect to port 80 with TLS, it can also be observed by issuing
        $ openssl s_client -connect alpinelinux.org:80
      
      This bug was introduced in commit:
      7158474f libfetch: keep http auth only if redirect is for the same host
      8e993fe9
  13. Jan 19, 2021
    • Timo Teräs's avatar
      libfetch: fix connection pooling for proxied http/https requests · acca5cbf
      Timo Teräs authored
      The connection pooling was broken in two ways:
      
       1. The original URL was always used as the connection pool URL,
          resulting in duplicate connections to the proxy for http URLs
          (each http URL would get separate proxy connection)
      
       2. The cache_url stored was always the socket level connect URL.
          In case of HTTPS, the lookup was done done with the real URL,
          but the proxy URL was stored as the "cache URL". Thus HTTPS
          CONNECT connections were never re-used.
      
      This fixes the code with following logic:
      
       1. The cache key url is the real URL when no-proxy, or when HTTPS
          with proxy (the socket is connected to proxy, but logically it
          is connected to the real URL due to HTTP CONNECT request).
          And for HTTP with proxy, it's the proxy URL so same proxy
          connection can be reused for all requests going through it.
      
       2. fetch_connect() now gets cache key URL separately, and it always
          gets the same value as the fetch_cache_get() calls.
      acca5cbf
    • Conny Seifert's avatar
      libfetch: fix parsing of proxy response to CONNECT requests · 4087ab92
      Conny Seifert authored and Timo Teräs's avatar Timo Teräs committed
      Instead of skipping just one line, properly parse the response headers.
      
      [TT: reworded commit message]
      4087ab92
  14. Oct 06, 2020
  15. Mar 25, 2020
    • Timo Teräs's avatar
      libfetch: fixups to packetization socket option setting · eae92bba
      Timo Teräs authored
      - split the code to a helper function
      - do not set sockets to corked state when putting back to
        cache so socket state is always deterministic
      - cork/uncork also when sending CONNECT to a proxy, this
        can reduce a little bit the latency how fast the packet
        gets sent out
      - also pair corking with uncorking in http_request to make
        it more obvious pairing
      eae92bba
    • Alex Wauck's avatar
      libfetch: minor HTTP handling improvement · 09dbe46a
      Alex Wauck authored and Timo Teräs's avatar Timo Teräs committed
      The recent TCP_CORK change missed this bit of code.  This change
      should improve performance a bit when making HTTP requests by calling
      http_cmd only once instead of three times.
      09dbe46a
  16. Feb 18, 2020
    • Timo Teräs's avatar
      libfetch: support TCP_CORK · 271047cc
      Timo Teräs authored
      Unfortunately libfetch operates on raw sockets and is sending
      each HTTP request line using separate syscall which causes the
      HTTP request to be sent as multiple packets over the wire in most
      configurations. This is not good for performance, but can also
      cause subtle breakage if there's DPI firewall that does not get
      the Host header.
      
      Incidentally, it seems that on BSDs libfetch already sets
      TCP_NOPUSH optimize the packetization. This commit adds same
      logic for using TCP_CORK if available. When using TCP_CORK
      there is no requirement to set TCP_NODELAY as uncorking will
      also cause immediate send. Keep TCP_NODELAY in the fallback
      codepaths.
      
      Long term, it might make sense to replace or rewrite libfetch
      to use application level buffering.
      271047cc
  17. Feb 13, 2019
    • Timo Teräs's avatar
      fix strncpy bounds errors · 44daf808
      Timo Teräs authored
      error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
      
      Based on patch by Elan Ruusamäe <glen@delfi.ee>
      44daf808
  18. Jan 03, 2018
  19. Oct 05, 2017
Loading