1. 29 Aug, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: only poll IO stream when needed · 35f1bac5
      Carlos Garcia Campos authored
      Instead of having two pollable sources constantly running, always try to
      read/write without blocking and start polling if the operation returns
      G_IO_ERROR_WOULD_BLOCK. This patch also fixes test
      /websocket/direct/close-after-close that was passing but not actually
      testing what we wanted, because the client close was never sent. When
      the mutex is released, the frame has been queued, but not sent.
      35f1bac5
  2. 23 Aug, 2019 2 commits
  3. 22 Aug, 2019 3 commits
    • Normen Bolling's avatar
      Added a comment describing why it is necessary to handle · 4bb95ada
      Normen Bolling authored
      the header "Transfer-Encoding: identity" although it is
      invalid regarding RFC 7230.
      
      Issue #148
      4bb95ada
    • Thomas Bluemel's avatar
      Handle response header Transfer-Encoding: identity · a1148a04
      Thomas Bluemel authored
      Don't set the encoding to SOUP_ENCODING_UNRECOGNIZED if the
      Transfer-Encoding value is "identity". This allows
      soup_message_headers_get_encoding to determine the encoding
      based on the other headers present (if any).
      
      Fixes #148
      a1148a04
    • tombailo's avatar
      soup-session: Use a separate GCancellable instance for internal and external cancellation · f0d2af22
      tombailo authored
      This commit changes the way the user-supplied GCancellable is handled in
      the implementation of soup_session_send_async() and soup_session_send().
      Previously the user-supplied GCancellable replaced the instance on the
      SoupMessageQueueItem used to queue the request. In the event of a
      request being internally re-queued, the GCancellable would be
      reset, which was problematic if the GCancellable had been passed in by
      client code which might be using the same instance to cancel soup
      requests and to perform application-specific  cancellation.
      
      This commit changes the implementation of the above two functions so
      that the user-supplied instance is chained to the internal instance via
      a callback so that cancelling it cancels the internal instance while the
      two objects can maintain their own state.
      
      A test to test the use of a cancellable with soup_session_send() is also
      added to connection-test.c.
      f0d2af22
  4. 21 Aug, 2019 3 commits
  5. 20 Aug, 2019 2 commits
  6. 13 Aug, 2019 2 commits
  7. 07 Aug, 2019 1 commit
  8. 06 Aug, 2019 1 commit
  9. 05 Aug, 2019 2 commits
  10. 31 Jul, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: add support for permessage-deflate extension · 13cea0fd
      Carlos Garcia Campos authored
      Add new API to add WebSocket extensions to SoupSession and SoupServer
      and include an implementation of permessage-deflate extension (see RFC
      7692). In the client side, supported extensions are added to the session
      as sub-features of a new session feature, SoupWebsocketExtensionManager.
      In the client side, supported extensions are added/removed directly using
      the new SoupServer API. All functions to negotiate the handshake
      (client_prepare, client_verify, server_check and server_process) have
      now a _with_extensions alternative to handle the extensions.
      13cea0fd
  11. 22 Jul, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: allow to send close frames with no body · e590c906
      Carlos Garcia Campos authored
      Using the code SOUP_WEBSOCKET_CLOSE_NO_STATUS. The spec says that code
      should not be included in a frame, but that doesn't mean we can't use it
      on the API level to mean no status. We were using 0 internally which is
      not a valid code either. When an empty close frame is received we still
      reply with a SOUP_WEBSOCKET_CLOSE_NORMAL code frame, but we return
      SOUP_WEBSOCKET_CLOSE_NO_STATUS from
      soup_websocket_connection_get_close_code() because that's actually what
      we received.
      e590c906
  12. 19 Jul, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: ignore any messages after close has been sent and received · d9c729aa
      Carlos Garcia Campos authored
      We currently ignore data frames when close has been received, but we
      should also ignore any frame after close has been sent and received.
      Currently, if we receive two close frames we end up with the code and
      reason of the second frame, while the RFC says: "The WebSocket
      Connection Close Code is defined as the status code contained in the
      first Close control frame received by the application implementing
      this protocol."
      d9c729aa
  13. 12 Jul, 2019 1 commit
  14. 10 Jul, 2019 1 commit
    • Claudio Saavedra's avatar
      SoupMessage: seal access to private members · 74866bba
      Claudio Saavedra authored
      Remove the GET_PRIVATE macro and add private getters and setters
      for all private members that are accessed internally. This cleans
      all deprecation warnings generated from using the GET_PRIVATE macro.
      74866bba
  15. 07 Jul, 2019 1 commit
    • Thibaut Robert's avatar
      ntlm: fix ntlmv2 authentication · c51f9f63
      Thibaut Robert authored
      This patch add the NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY bit in the flags
      of the NTLM type 3 response when using NTLMv2. This seems to be required for
      some servers.
      c51f9f63
  16. 04 Jul, 2019 2 commits
  17. 27 Jun, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: allow null characters in text messages data · 109bb2f6
      Carlos Garcia Campos authored
      RFC 6455 says that text messages should contains valid UTF-8, and null
      characters valid according to RFC 3629. However, we are using
      g_utf8_validate(), which considers null characters as errors, to
      validate WebSockets text messages. This patch adds an internal
      utf8_validate() function based on g_utf8_validate() but allowing null
      characters and just returning a gboolean since we are always ignoring
      the end parameter in case of errors.
      soup_websocket_connection_send_text() assumes the given text is null
      terminated, so we need a new public function to allow sending text
      messages containing null characters. This patch adds
      soup_websocket_connection_send_message() that receives a
      SoupWebsocketDataType and GBytes, which is consistent with
      SoupWebsocketConnection::message signal.
      109bb2f6
  18. 25 Jun, 2019 1 commit
    • Carlos Garcia Campos's avatar
      WebSockets: closed signal not emitted when io stream is SoupIOStream · fd794a95
      Carlos Garcia Campos authored
      That's the case of connections created by SoupSession. In that case, if
      the server hasn't closed its end of the connection, we fail to shutdown
      the client end, because shutdown_wr_io_stream() does nothing when the io
      stream is not a GSocketConnection. So, for SoupIOStream we need to get
      the base io stream which is a GSocketConnection.
      fd794a95
  19. 19 Jun, 2019 2 commits
  20. 18 Jun, 2019 1 commit
  21. 17 Jun, 2019 2 commits
    • Carlos Garcia Campos's avatar
      WebSockets: fix runtime critical warning when handshake fails · 7939cfbf
      Carlos Garcia Campos authored
      (process:20018): GLib-GIO-CRITICAL **: 12:26:09.686: g_task_return_error: assertion 'G_IS_TASK (task)' failed
      (process:20018): GLib-GObject-CRITICAL **: 12:26:09.686: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
      
      We are trying to complete the GTask twice, first in
      websocket_connect_async_stop() and then in
      websocket_connect_async_complete(). The latter should only be called if
      the item finishes before got-informational signal is emitted.
      7939cfbf
    • Carlos Garcia Campos's avatar
      WebSockets: message never finishes when handshake fails · 4aa232cb
      Carlos Garcia Campos authored
      When soup_websocket_client_verify_handshake() returns TRUE, the
      message connection is stolen and soup_message_io_steal() is called for
      the message, making the message to move to FINISHING state. However,
      when it returns FALSE, the message stays in RUNNING state forever. We
      should call soup_message_io_finished() in that case to ensure the
      messages transitions to FINISHING state.
      4aa232cb
  22. 10 Jun, 2019 2 commits
    • Claudio Saavedra's avatar
      hsts-db: further fix for format string of stored policies · 7fc86f20
      Claudio Saavedra authored
      The age and expiration date should be unsigned long, not just
      long.
      7fc86f20
    • Claudio Saavedra's avatar
      hsts: accept the Strict-Transport-Security header regardless of casing · 16bb5805
      Claudio Saavedra authored
      For some reason a strcmp() was used where a case-insensitive search should
      be used. This was further hidden by the fact that SoupMessageHeaders interns
      the name of headers, so the first time a header is seen by the library will
      be the casing that is used, rendering the case-insensitivity test useless.
      
      Fix the string comparison and move the test for sensitivity to the top so that
      it runs first and the interned STS header name is the allcaps one that will
      allow the test to work.
      16bb5805
  23. 06 Jun, 2019 1 commit
  24. 05 Jun, 2019 1 commit
    • Claudio Saavedra's avatar
      Add SoupHSTSEnforcer:hsts-enforced signal · afe18148
      Claudio Saavedra authored
      After working on the HSTS feature for WebKit it became obvious
      that relying on the SoupMessage::uri property changes is far from
      ideal. So let's add a signal that will be emitted whenever the
      enforcer does its thing wih a SoupMessage.
      afe18148
  25. 03 Jun, 2019 1 commit
  26. 28 May, 2019 1 commit
  27. 22 May, 2019 2 commits