From c150ffb220c15f10076b86fb2776a782a4d098ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 24 Jan 2023 10:03:59 +0100 Subject: Gun 2.0 --- docs/en/gun/2.0/guide/introduction.asciidoc | 2 +- docs/en/gun/2.0/guide/introduction/index.html | 2 +- docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc | 43 +++++++++++++++++++++- .../en/gun/2.0/guide/migrating_from_1.3/index.html | 22 ++++++++++- 4 files changed, 65 insertions(+), 4 deletions(-) (limited to 'docs/en/gun/2.0/guide') diff --git a/docs/en/gun/2.0/guide/introduction.asciidoc b/docs/en/gun/2.0/guide/introduction.asciidoc index 097cf396..948dde95 100644 --- a/docs/en/gun/2.0/guide/introduction.asciidoc +++ b/docs/en/gun/2.0/guide/introduction.asciidoc @@ -21,7 +21,7 @@ Gun is developed for Erlang/OTP 22.0 and newer. Gun uses the ISC License. ---- -Copyright (c) 2013-2020, Loïc Hoguin +Copyright (c) 2013-2023, Loïc Hoguin Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/docs/en/gun/2.0/guide/introduction/index.html b/docs/en/gun/2.0/guide/introduction/index.html index 2035c5f3..be153533 100644 --- a/docs/en/gun/2.0/guide/introduction/index.html +++ b/docs/en/gun/2.0/guide/introduction/index.html @@ -70,7 +70,7 @@

Gun is developed for Erlang/OTP 22.0 and newer.

License

Gun uses the ISC License.

-
Copyright (c) 2013-2020, Loïc Hoguin <essen@ninenines.eu>
+
Copyright (c) 2013-2023, Loïc Hoguin <essen@ninenines.eu>
 
 Permission to use, copy, modify, and/or distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
diff --git a/docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc b/docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc
index 2e71a904..59f3381c 100644
--- a/docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc
+++ b/docs/en/gun/2.0/guide/migrating_from_1.3.asciidoc
@@ -52,6 +52,12 @@ Gun 2.0 requires Erlang/OTP 22.0 or greater.
   option controls how long we are willing to wait at most
   before closing the connection.
 
+* Gun will better detect connection failures by checking the
+  return value from sending data to the socket. This applies
+  to all supported protocols. In addition, Gun now enables
+  `send_timeout_close` with a `send_timeout` value defaulting
+  to 15s.
+
 * Flow control has been added. It allows limiting the number
   of data/Websocket messages Gun sends to the calling process.
   Gun will stop reading from the socket or stop updating the
@@ -107,6 +113,20 @@ Gun 2.0 requires Erlang/OTP 22.0 or greater.
   improve performance or lower the memory usage, for
   example.
 
+* A new `keepalive_tolerance` option for HTTP/2 enables
+  closing the connection automatically when ping acks
+  are not received in a timely manner. It nicely
+  complements the `keepalive` option that makes Gun
+  send pings.
+
+* Gun now supports Websocket subprotocol negotiation
+  and the feature is fully documented and tested.
+  This can be used to create handlers that will
+  implement a protocol from within the Gun process itself.
+  The negotiation is enabled by setting the `protocols`
+  setting. The `default_protocol` and `user_opts`
+  settings are also useful.
+
 * It is now possible to send many Websocket frames in
   a single `gun:ws_send/3` call.
 
@@ -139,7 +159,7 @@ Gun 2.0 requires Erlang/OTP 22.0 or greater.
   (for example during state transitions when switching
   protocols or connecting to proxies).
 
-* Update Cowlib to 2.11.0.
+* Update Cowlib to 2.12.0.
 
 === Experimental features added
 
@@ -286,3 +306,24 @@ Gun 2.0 requires Erlang/OTP 22.0 or greater.
 
 * Fix a crash in gun:info/1 when the socket was closed before
   we call Transport:sockname/1.
+
+* Fix flushing by stream reference. When the `gun_inform`
+  message was flushed the function would switch to flushing
+  all messages from the pid instead of only messages from
+  the given stream.
+
+* Allow setting a custom SNI value.
+
+* Fix double sending of last chunk in HTTP/1.1 when Gun is
+  asked to send empty data before closing the stream.
+
+* Gun will now properly ignore parameters when the media
+  type is text/event-stream.
+
+* Avoid noisy crashes in the TLS over TLS code.
+
+* Gun will now include the StreamRef of Websocket streams
+  when sending `gun_down` messages.
+
+* Gun will no longer reject HTTP proxies that use HTTP/1.0
+  for the version in their response.
diff --git a/docs/en/gun/2.0/guide/migrating_from_1.3/index.html b/docs/en/gun/2.0/guide/migrating_from_1.3/index.html
index 7c54aa6b..00d39fdc 100644
--- a/docs/en/gun/2.0/guide/migrating_from_1.3/index.html
+++ b/docs/en/gun/2.0/guide/migrating_from_1.3/index.html
@@ -73,6 +73,8 @@
 
 
  • Graceful shutdown has been implemented. Graceful shutdown can be initiated on the client side by calling the new function gun:shutdown/1 or when the owner process goes away; or on the peer side via the connection: close HTTP/1.1 header, the HTTP/2 GOAWAY frame or the Websocket close frame. Gun will try to complete existing streams when possible; other streams get canceled immediately. The closing_timeout option controls how long we are willing to wait at most before closing the connection.
  • +
  • Gun will better detect connection failures by checking the return value from sending data to the socket. This applies to all supported protocols. In addition, Gun now enables send_timeout_close with a send_timeout value defaulting to 15s. +
  • Flow control has been added. It allows limiting the number of data/Websocket messages Gun sends to the calling process. Gun will stop reading from the socket or stop updating the protocol's flow control window when applicable as well, to apply some backpressure to the remote endpoint(s). It is disabled by default and can be applied on a per-request basis if necessary.
  • An event handler interface has been added providing access to many internal Gun events. This can be used for a variety of purposes including logging, tracing or otherwise instrumenting a Gun connection. @@ -95,6 +97,10 @@
  • Many HTTP/2 options have been added, allowing great control over how Gun and the remote endpoint are using the HTTP/2 connection. They can be used to improve performance or lower the memory usage, for example.
  • +
  • A new keepalive_tolerance option for HTTP/2 enables closing the connection automatically when ping acks are not received in a timely manner. It nicely complements the keepalive option that makes Gun send pings. +
  • +
  • Gun now supports Websocket subprotocol negotiation and the feature is fully documented and tested. This can be used to create handlers that will implement a protocol from within the Gun process itself. The negotiation is enabled by setting the protocols setting. The default_protocol and user_opts settings are also useful. +
  • It is now possible to send many Websocket frames in a single gun:ws_send/3 call.
  • Gun may now send Websocket ping frames automatically at intervals determined by the keepalive option. It is disabled by default. @@ -111,7 +117,7 @@
  • Many improvements have been done to postpone or reject requests and other operations while in the wrong state (for example during state transitions when switching protocols or connecting to proxies).
  • -
  • Update Cowlib to 2.11.0. +
  • Update Cowlib to 2.12.0.
  • Experimental features added

    @@ -197,6 +203,20 @@
  • Fix a crash in gun:info/1 when the socket was closed before we call Transport:sockname/1.
  • +
  • Fix flushing by stream reference. When the gun_inform message was flushed the function would switch to flushing all messages from the pid instead of only messages from the given stream. +
  • +
  • Allow setting a custom SNI value. +
  • +
  • Fix double sending of last chunk in HTTP/1.1 when Gun is asked to send empty data before closing the stream. +
  • +
  • Gun will now properly ignore parameters when the media type is text/event-stream. +
  • +
  • Avoid noisy crashes in the TLS over TLS code. +
  • +
  • Gun will now include the StreamRef of Websocket streams when sending gun_down messages. +
  • +
  • Gun will no longer reject HTTP proxies that use HTTP/1.0 for the version in their response. +
  • -- cgit v1.2.3