update debugServerCall for changes to fields. Fixes debug builds. (#33)

This commit is contained in:
Connor Clark 2016-06-23 14:34:01 -07:00 committed by Joel Stanley
parent a530faf912
commit 51891bb026

View file

@ -32,20 +32,18 @@ serverCallCancel sc code reason =
debugServerCall :: ServerCall -> IO () debugServerCall :: ServerCall -> IO ()
#ifdef DEBUG #ifdef DEBUG
debugServerCall call@(ServerCall (C.Call ptr) _ _ _) = do debugServerCall call@ServerCall{..} = do
let (C.Call ptr) = unServerCall
grpcDebug $ "debugServerCall(U): server call: " ++ (show ptr) grpcDebug $ "debugServerCall(U): server call: " ++ (show ptr)
grpcDebug $ "debugServerCall(U): metadata ptr: " grpcDebug $ "debugServerCall(U): metadata: "
++ show (requestMetadataRecv call) ++ show requestMetadataRecv
metadataArr <- peek (requestMetadataRecv call) forM_ parentPtr $ \parentPtr' -> do
metadata <- C.getAllMetadataArray metadataArr
grpcDebug $ "debugServerCall(U): metadata received: " ++ (show metadata)
forM_ (parentPtr call) $ \parentPtr' -> do
grpcDebug $ "debugServerCall(U): parent ptr: " ++ show parentPtr' grpcDebug $ "debugServerCall(U): parent ptr: " ++ show parentPtr'
(C.Call parent) <- peek parentPtr' (C.Call parent) <- peek parentPtr'
grpcDebug $ "debugServerCall(U): parent: " ++ show parent grpcDebug $ "debugServerCall(U): parent: " ++ show parent
grpcDebug $ "debugServerCall(U): callDetails ptr: " grpcDebug $ "debugServerCall(U): deadline: " ++ show callDeadline
++ show (callDetails call) grpcDebug $ "debugServerCall(U): method: " ++ show callMethod
--TODO: need functions for getting data out of call_details. grpcDebug $ "debugServerCall(U): host: " ++ show callHost
#else #else
{-# INLINE debugServerCall #-} {-# INLINE debugServerCall #-}
debugServerCall = const $ return () debugServerCall = const $ return ()