Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure put_line makes only a single request when streaming, two

separate requests often not liked.
  • Loading branch information...
commit 0dc1c248a43956022727eec1e95bd6bdf61dba43 1 parent b563695
@berenddeboer authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 src/abstract/abstract_socket.e
View
23 src/abstract/abstract_socket.e
@@ -25,6 +25,8 @@ inherit
is_blocking_io,
set_blocking_io,
supports_nonblocking_io
+ redefine
+ put_line
end
@@ -57,7 +59,7 @@ feature {NONE} -- Socket creation
Result := abstract_socket (
a_domain,
a_type,
- 0)
+ 0) -- 0 is the default protocol for `a_type'
if Result = unassigned_value then
raise_posix_error
end
@@ -136,6 +138,25 @@ feature -- Change
end
+feature -- Output
+
+ put_line (a_string: STRING)
+ -- Write `a_string' to output stream
+ -- followed by a line separator.
+ local
+ s: STRING
+ do
+ if is_streaming then
+ create s.make (a_string.count + eol.count)
+ s.append_string (a_string)
+ s.append_string (eol)
+ put_string (s)
+ else
+ precursor (a_string)
+ end
+ end
+
+
feature {NONE} -- Implementation
address_length: INTEGER
Please sign in to comment.
Something went wrong with that request. Please try again.