Revision 4cd79ca8 htools/Ganeti/Luxi.hs

b/htools/Ganeti/Luxi.hs
67 67
import System.Timeout
68 68
import qualified Network.Socket as S
69 69

  
70
import Ganeti.BasicTypes
70 71
import Ganeti.JSON
71
import Ganeti.HTools.Types
72 72
import Ganeti.Utils
73 73

  
74 74
import Ganeti.Constants
......
214 214
getClient :: String -> IO Client
215 215
getClient path = do
216 216
  s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
217
  withTimeout connTimeout "creating luxi connection" $
217
  withTimeout luxiDefCtmo "creating luxi connection" $
218 218
              S.connect s (S.SockAddrUnix path)
219 219
  rf <- newIORef B.empty
220 220
  h <- S.socketToHandle s ReadWriteMode
......
250 250

  
251 251
-- | Sends a message over a luxi transport.
252 252
sendMsg :: Client -> String -> IO ()
253
sendMsg s buf = withTimeout queryTimeout "sending luxi message" $ do
253
sendMsg s buf = withTimeout luxiDefRwto "sending luxi message" $ do
254 254
  let encoded = UTF8.fromString buf
255 255
      handle = socket s
256 256
  B.hPut handle encoded
......
262 262
-- message and the leftover buffer contents.
263 263
recvUpdate :: Handle -> B.ByteString -> IO (B.ByteString, B.ByteString)
264 264
recvUpdate handle obuf = do
265
  nbuf <- withTimeout queryTimeout "reading luxi response" $ do
265
  nbuf <- withTimeout luxiDefRwto "reading luxi response" $ do
266 266
            _ <- hWaitForInput handle (-1)
267 267
            B.hGetNonBlocking handle 4096
268 268
  let (msg, remaining) = B.break (eOM ==) nbuf

Also available in: Unified diff