[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/07: comm: Buffer the communication socket on the server si
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/07: comm: Buffer the communication socket on the server side. |
Date: |
Wed, 27 Jan 2016 14:00:25 +0000 |
civodul pushed a commit to branch master
in repository shepherd.
commit e4989cab043005af8e19a06703399f6a67f81eb7
Author: Ludovic Courtès <address@hidden>
Date: Wed Jan 27 14:33:43 2016 +0100
comm: Buffer the communication socket on the server side.
* modules/shepherd.scm (main): Add 'setvbuf' call.
* modules/shepherd/comm.scm (write-reply): Add 'force-output' call.
---
modules/shepherd.scm | 1 +
modules/shepherd/comm.scm | 5 ++++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index d258e7f..e8bd44f 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -204,6 +204,7 @@
(let next-command ()
(match (accept sock)
((command-source . client-address)
+ (setvbuf command-source _IOFBF 1024)
(process-connection command-source))
(_ #f))
(next-command))))))
diff --git a/modules/shepherd/comm.scm b/modules/shepherd/comm.scm
index 7590171..0228f63 100644
--- a/modules/shepherd/comm.scm
+++ b/modules/shepherd/comm.scm
@@ -144,7 +144,10 @@ wrong---premature end-of-file, invalid sexp, etc."
(result ,(result->sexp result))
(error ,error)
(messages ,messages))
- port))))
+ port)
+
+ ;; PORT may be buffered so make sure the command goes out.
+ (force-output port))))
;; This generic function must be extended to provide sexp representations of
;; results that go in <command-reply> objects.
- [shepherd] branch master updated (83567c4 -> bc7757c), Ludovic Courtès, 2016/01/27
- [shepherd] 01/07: build: Really make sure installed .go files are newer., Ludovic Courtès, 2016/01/27
- [shepherd] 04/07: comm: Buffer the communication socket on the server side.,
Ludovic Courtès <=
- [shepherd] 03/07: comm: Buffer the communication socket on the client side., Ludovic Courtès, 2016/01/27
- [shepherd] 06/07: doc: Improve the introduction., Ludovic Courtès, 2016/01/27
- [shepherd] 07/07: Update 'NEWS'., Ludovic Courtès, 2016/01/27
- [shepherd] 02/07: comm: The 'arguments' of a command is a list., Ludovic Courtès, 2016/01/27
- [shepherd] 05/07: doc: Document the sexp protocol., Ludovic Courtès, 2016/01/27