LGTM, thanks

On Mon, Nov 16, 2015 at 3:57 PM, 'Klaus Aehlig' via ganeti-devel <
[email protected]> wrote:

> When sending an answer over a domain socket, the recipient
> won't process that answer anyway before it is complete. So
> we can as well assemble one ByteString first and send it over
> the wire all at once, thus saving a few system calls.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/UDSServer.hs | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/Ganeti/UDSServer.hs b/src/Ganeti/UDSServer.hs
> index 8e27c5a..868c4e9 100644
> --- a/src/Ganeti/UDSServer.hs
> +++ b/src/Ganeti/UDSServer.hs
> @@ -77,9 +77,7 @@ import Control.Monad.Trans.Control
>  import Control.Exception (catch)
>  import Control.Monad
>  import qualified Data.ByteString as B
> -import qualified Data.ByteString.Lazy as BL
>  import qualified Data.ByteString.UTF8 as UTF8
> -import qualified Data.ByteString.Lazy.UTF8 as UTF8L
>  import Data.IORef
>  import Data.List
>  import Data.Word (Word8)
> @@ -288,9 +286,9 @@ clientToFd client | rh == wh  = join (,) <$>
> handleToFd rh
>  -- | Sends a message over a transport.
>  sendMsg :: Client -> String -> IO ()
>  sendMsg s buf = withTimeout (sendTmo $ clientConfig s) "sending a
> message" $ do
> -  let encoded = UTF8L.fromString buf
> +  let encoded = UTF8.fromString buf
>        handle = wsocket s
> -  BL.hPut handle encoded
> +  B.hPut handle encoded
>    B.hPut handle bEOM
>    hFlush handle
>
> --
> 2.6.0.rc2.230.g3dd15c0
>
>
Hrvoje Ribicic
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und
löschen Sie die E-Mail und alle Anhänge. Vielen Dank.

This e-mail is confidential. If you are not the right addressee please do
not forward it, please inform the sender, and please erase this e-mail
including any attachments. Thanks.

Reply via email to