1. 11 Nov, 2019 1 commit
  2. 07 Nov, 2019 1 commit
  3. 31 Oct, 2019 1 commit
    • Joe Lee's avatar
      Make HttpClient adapter preserve exception behavior · ea4dc7f0
      Joe Lee authored
      Ideally, the HttpClient/HttpServer adapters should maintain the invariant that
      the behavior of a given client is the same as the behavior of
      newHttpClient(newHttpService(client)).  Prior to this change, the HttpClient
      wrapper lazily called request(), so a client whose request() eagerly threw an
      exception could produce a different exception when called directly versus when
      wrapped -- the laziness allowed additional code to run.  This was particularly
      evident when making a request with a body, since code using a wrapped client
      would be able to set up a subsequent BlockedWrite, eventually resulting in a
      "read end of pipe was aborted" exception instead of the actual exception.
      
      This change makes HttpClientAdapter::request() execute the wrapped request()
      eagerly.
      
      (Note that it partially undoes 90d48343... Hopefully, it preserves the desired
      behavior added there.)
      ea4dc7f0
  4. 28 Oct, 2019 1 commit
  5. 22 Oct, 2019 1 commit
  6. 14 Oct, 2019 1 commit
    • Vitali Lovich's avatar
      Suppress MSVC warnings in headers files · 93e5be76
      Vitali Lovich authored
      For Visual Studio we have to wrap the headers with push/pop pragmas
      at the top and bottom of the file.
      
      Define common macros for suppress/unsuppress KJ & the appropriate macros
      for CAPNP begin/end header wrappers. Because there's a chicken egg
      problem the KJ_BEGIN_HEADER/CAPNP_BEGIN_HEADER macros are placed below
      all includes to ensure that the appropriate common.h file has been
      sourced.
      93e5be76
  7. 03 Oct, 2019 1 commit
  8. 02 Oct, 2019 3 commits
    • Kenton Varda's avatar
      Fix handling of queued RT signals. · c84d57a3
      Kenton Varda authored
      For regular (non-RT) POSIX signals, the process can only have at most one instance of each signal queued for delivery at a time. If another copy of the signal arrives before the first is delivered, the new signal is ignored. The idea was that signals are only meant to wake the process up to check some input; the signal itself is not the input.
      
      POSIX RT signals are different. Multiple copies of the same signal can be queued, and each is delivered separately. Each signal may contain some additional information that needs to be processed. The signals themselves are input.
      
      UnixEventPort's `onSignal()` method returns a Promise that resolves the next time the signal is delivered. When the Promise is resolved, the signal is also supposed to be blocked until `onSignal()` can be called again, so that the app cannot miss signals delivered in between.
      
      However, the epoll/signalfd implementation had a bug where it would pull _all_ queued signals off the `signalfd` at once, only delivering the first instance of each signal number and dropping subsequent instances on the floor. That's fine for regular signals, but not RT signals.
      
      This change fixes the bug and adds a test. Incidentally, the poll()-based implementation has been correct all along.
      c84d57a3
    • Kenton Varda's avatar
      Fix bug when multiple cmsgs are present. · 44c6b461
      Kenton Varda authored
      I don't really know how to test this since the other cmsg types are bizarre and non-portable, but they do exist.
      44c6b461
    • Kenton Varda's avatar
      Test that headers are allowed to contain '.'s. · 11f612a9
      Kenton Varda authored
      This and many other characters are surprisingly allowed by the relevant RFCs. But it turns out we implemented the RFCs correctly, so yay.
      11f612a9
  9. 30 Sep, 2019 1 commit
  10. 16 Sep, 2019 1 commit
  11. 11 Sep, 2019 5 commits
  12. 10 Sep, 2019 1 commit
  13. 09 Sep, 2019 1 commit
    • Kenton Varda's avatar
      Fix http-test.c++ to avoid dubious assumptions about gather-writes. · 8f9717d2
      Kenton Varda authored
      Most (all?) implementations of `write(ArrayPtr<const ArrayPtr<const byte>>)`, if the outer array contains only one inner array, do not use the outer array again after the initial call returns (as opposed to the promise resolving). But, this is not a safe assumption and http-test.c++ should not be relying on it.
      
      (I found this when I tried forcing all writes to complete asynchronously to check if it resulted in any bugs. This is all I found.)
      8f9717d2
  14. 03 Sep, 2019 3 commits
  15. 20 Aug, 2019 2 commits
  16. 02 Aug, 2019 1 commit
    • Harris Hancock's avatar
      Report raw HTTP content when handling client protocol errors in kj-http · 350b2f2b
      Harris Hancock authored
      This information is typically necessary to debug such protocol errors. However, it requires special handling, since it could contain sensitive information.
      
      The code which has the best view on protocol errors is HttpHeaders::tryParseRequest(), which previously returned an empty Maybe<Request> on failure. This commit changes that function to return a OneOf<Request, ProtocolError>. This required some surgery in various other parts of the code to deal with the OneOf.
      350b2f2b
  17. 23 Jul, 2019 1 commit
  18. 22 Jul, 2019 3 commits
  19. 10 Jul, 2019 1 commit
  20. 08 Jul, 2019 10 commits