Skip to content

Commit

Permalink
adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Dec 21, 2024
1 parent 3751f81 commit 6951412
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tls/Network/TLS/Extension.hs-boot
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
-- This is a breaker for cyclic imports:
--
-- - Network.TLS.Extension imports Network.TLS.Struct
-- - Network.TLS.Extension imports Network.TLS.Packet
--
-- - Network.TLS.Struct imports Network.TLS.Extension
--
-- - Network.TLS.Packet imports Network.TLS.Struct
--
-- Originally, ExtensionRaw was defined in Network.TLS.Struct and no
-- cyclic imports exist. It is moved into Network.TLS.Extension for
-- pretty-printing, so the cyclic imports happen.
module Network.TLS.Extension where

import Data.ByteString
Expand Down
4 changes: 4 additions & 0 deletions tls/Network/TLS/Types/Cipher.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ instance Show CipherID where
eqID c = cipherID c == CipherID n
dict = unsafePerformIO $ readIORef globalCipherDict

-- "ciphersuite" is designed extensible.
-- So, it's not available from internal modules.
-- This is a compromise to gule "ciphersuite" to Show CipherID.

{-# NOINLINE globalCipherDict #-}
globalCipherDict :: IORef [Cipher]
globalCipherDict = unsafePerformIO $ newIORef []
Expand Down

0 comments on commit 6951412

Please sign in to comment.