Skip to content

Commit 6b92ded

Browse files
authored
Allow persistent=false to be set externally (#27)
* allow persistent=false to be set externally
1 parent 656d247 commit 6b92ded

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/protocol/http1/connection.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def initialize(stream, persistent = true)
5959
attr :stream
6060

6161
# Whether the connection is persistent.
62-
attr :persistent
62+
# This determines what connection headers are sent in the response and whether
63+
# the connection can be reused after the response is sent.
64+
# This setting is automatically managed according to the nature of the request
65+
# and response.
66+
# Changing to false is safe.
67+
# Changing to true from outside this class should generally be avoided and,
68+
# depending on the response semantics, may be reset to false anyway.
69+
attr_accessor :persistent
6370

6471
# The number of requests processed.
6572
attr :count

0 commit comments

Comments
 (0)