Skip to content
Snippets Groups Projects

More HTTP fixes

Merged Andrej Shadura requested to merge http-fixes-2 into apertis/v2021dev3
  1. Aug 06, 2020
    • Andrej Shadura's avatar
      Update the changelog · a3a349ae
      Andrej Shadura authored
      
      Signed-off-by: default avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
      Unverified
      a3a349ae
    • Julian Andres Klode's avatar
      basehttp: Correctly handle non-transient failure from RunData() · 3b2dfcf8
      Julian Andres Klode authored and Andrej Shadura's avatar Andrej Shadura committed
      When we failed after a retry, we only communicated failure as
      transient, but this seems wrong, especially given that the code
      now always triggers a retry when Die() is called, as Die() closes
      the server fd.
      
      Instead, remove the error handling in that code path, and reuse
      the existing fatal-ish error code handling path.
      Unverified
      3b2dfcf8
    • Julian Andres Klode's avatar
      http: Fix infinite loop on read errors · 761dedba
      Julian Andres Klode authored and Andrej Shadura's avatar Andrej Shadura committed
      If there was a transient error and the server fd was closed, the
      code would infinitely retry - it never reached FailCounter >= 2
      because it falls through to the end of the loop, which sets
      FailCounter = 0.
      
      Add a continue just like the DNS rotation code has, so that the
      retry actually fails after 2 attempts.
      
      Also rework the error logic to forward the actual error message.
      Unverified
      761dedba
    • Julian Andres Klode's avatar
      http: Always write to the file if there's something to write · 91ab0a67
      Julian Andres Klode authored and Andrej Shadura's avatar Andrej Shadura committed
      We only add the file to the select() call if we have data to
      write to it prior to the select() call. This is problematic:
      
      Assuming we enter Go() with no data to write to the file,
      but we read some from the server as well as an EOF, we end
      up not writing it to the file because we did not add the file
      to the select.
      
      We can't always add the file to the select(), because it's
      basically always ready and we don't want to wake up if we
      don't have anything to read or write.
      
      So for a solution, let's just always write data to the file
      if there's data to write to it. If some gets leftover, or if
      some was already present when we started Go(), it will still
      be added to the select() call and unblock it.
      
      Closes: #959518
      Unverified
      91ab0a67
Loading