Permalink
Browse files

Revert "Touch the SSLContext in a couple of other places."

This reverts commit 45ebfb3.
  • Loading branch information...
1 parent 2e178d7 commit 76d4d904139ae1f7e236be777dec42e6813fef9d @gregorycollins gregorycollins committed Sep 19, 2012
Showing with 3 additions and 8 deletions.
  1. +3 −8 src/Snap/Internal/Http/Server/TLS.hs
@@ -174,7 +174,7 @@ endSession (NetworkSession _ aSSL _) = do
send :: IO () -> IO () -> NetworkSession -> ByteString -> IO ()
send tickleTimeout _ (NetworkSession _ aSSL sz) bs = go bs
where
- (SessionContext ssl ctx) = unsafeCoerce aSSL
+ (SessionContext ssl _) = unsafeCoerce aSSL
-- I think we have to chop the data into chunks here because HsOpenSSL
-- won't; of course, blaze-builder may already be doing this for us, but I
@@ -184,10 +184,6 @@ send tickleTimeout _ (NetworkSession _ aSSL sz) bs = go bs
else do
SSL.write ssl a
tickleTimeout
- -- FIXME(greg): fix this properly, see above
- -- Touch the context so that the garbage collector doesn't zap
- -- it.
- !_ <- contextGetCAStore ctx
go b
where
(a,b) = S.splitAt sz s
@@ -196,10 +192,9 @@ send tickleTimeout _ (NetworkSession _ aSSL sz) bs = go bs
------------------------------------------------------------------------------
recv :: IO b -> NetworkSession -> IO (Maybe ByteString)
recv _ (NetworkSession _ aSSL recvLen) = do
- b <- SSL.read ssl recvLen
- !_ <- contextGetCAStore ctx
+ b <- SSL.read ssl recvLen
return $! if S.null b then Nothing else Just b
where
- (SessionContext ssl ctx) = unsafeCoerce aSSL
+ (SessionContext ssl _) = unsafeCoerce aSSL
#endif

0 comments on commit 76d4d90

Please sign in to comment.