* [OSSTEST PATCH] ms-queuedaemon: Do not spin if client input is delayed/truncated
@ 2015-10-20 17:26 Ian Jackson
2015-10-21 8:53 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Ian Jackson @ 2015-10-20 17:26 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
chan-read-data would spin if `read' returns early because of
nonblocking mode.
Check whether the return value is the empty string (which can only
happen on eof or nonblocking lack of data, and we checked eof just
before), and if so, simply return. The fileevent remains set up so we
will be called again when more data arrives.
(Deployment/testing note: this change is currently live in Cambridge,
as I cowboyed it directly into ~osstest/daemons-testing.git, on
observing this misbehaviour.)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
tcl/daemonlib.tcl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tcl/daemonlib.tcl b/tcl/daemonlib.tcl
index 55bc385..972b5e2 100644
--- a/tcl/daemonlib.tcl
+++ b/tcl/daemonlib.tcl
@@ -166,6 +166,9 @@ proc chan-read-data {chan} {
chan-destroy $chan
return
}
+ if {![string length $got]} {
+ return
+ }
append data $got
incr len -[string length $got]
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [OSSTEST PATCH] ms-queuedaemon: Do not spin if client input is delayed/truncated
2015-10-20 17:26 [OSSTEST PATCH] ms-queuedaemon: Do not spin if client input is delayed/truncated Ian Jackson
@ 2015-10-21 8:53 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-10-21 8:53 UTC (permalink / raw)
To: Ian Jackson, xen-devel
On Tue, 2015-10-20 at 18:26 +0100, Ian Jackson wrote:
> chan-read-data would spin if `read' returns early because of
> nonblocking mode.
>
> Check whether the return value is the empty string (which can only
> happen on eof or nonblocking lack of data, and we checked eof just
> before), and if so, simply return. The fileevent remains set up so we
> will be called again when more data arrives.
>
> (Deployment/testing note: this change is currently live in Cambridge,
> as I cowboyed it directly into ~osstest/daemons-testing.git, on
> observing this misbehaviour.)
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-21 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 17:26 [OSSTEST PATCH] ms-queuedaemon: Do not spin if client input is delayed/truncated Ian Jackson
2015-10-21 8:53 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.