diff --git a/cbits/tlsinc.c b/cbits/tlsinc.c
--- a/cbits/tlsinc.c
+++ b/cbits/tlsinc.c
@@ -414,11 +414,15 @@
     int result;
     connection_t *c;
 
+    // Ok, here it is in the open, for everybody 
+    // to see:
+    signal(SIGPIPE, SIG_IGN);
+
     if (! threads_are_up)
     {
         threads_are_up = 1;
         thread_setup();
-    }
+    } 
 
     c = malloc (sizeof (connection_t));
     c->sslContext = NULL;
@@ -484,8 +488,8 @@
             perror("Could not set cipher");
             return 0;
         }
-        // The certificate (well-wired)
-        SSL_CTX_use_certificate_file(c->sslContext, certificate_filename, SSL_FILETYPE_PEM);
+        // Load a certificate in .pem format.
+        SSL_CTX_use_certificate_chain_file(c->sslContext, certificate_filename);
         SSL_CTX_use_PrivateKey_file(c->sslContext,  privkey_filename, SSL_FILETYPE_PEM);
         // Check the private key 
         result = SSL_CTX_check_private_key(c->sslContext);
@@ -516,7 +520,7 @@
     const int len = strlen(hostname);
     if ( len > 0 && hostname[len-1] == '\n' )
     { 
-        printf("HELLO THERE. I'M A FLIMSY C FUNCTION AND I CAN NOT REMOVE THE END-OF-LINE IN THE PROVIDED HOST NAME WITHOUT A TON OF LINES. I'M GOING TO SEGFAULT NOW. BYE.\n");
+        printf("HELLO THERE. I found some weird characters\n");
         *( (int*) 0) = 42; // <-- This is the answer
     }
 
diff --git a/hs-src/SecondTransfer.hs b/hs-src/SecondTransfer.hs
--- a/hs-src/SecondTransfer.hs
+++ b/hs-src/SecondTransfer.hs
@@ -1,6 +1,5 @@
 {-|
 Module      : SecondTransfer
-Description : A library for implementing HTTP\/2 servers supporting streaming requests and responses.
 Copyright   : (c) Alcides Viamontes Esquivel, 2015
 License     : BSD
 Maintainer  : alcidesv@zunzun.se
@@ -8,34 +7,34 @@
 Portability : POSIX
 
 This library implements enough of the HTTP/2  to build 
-compliant HTTP/2 servers. 
+compliant HTTP/2 servers. It also implements enough of 
+HTTP/1.1 so you can actually use it to build polyglot web-servers.
 
-Frame encoding and decoding is done with 
-Kazu Yamamoto's <http://hackage.haskell.org/package/http2 http2> package, our goal
-here is to sort the HTTP/2 frames according to the protocol. 
+For HTTP/2, frame encoding and decoding is done with 
+Kazu Yamamoto's <http://hackage.haskell.org/package/http2 http2> package.
+This library just takes care of making sense of sent and received
+frames.
 
 You can find more detailed information about this library at the page 
-<https://www.httptwo.com/second-transfer/> (but notice that the site uses
-the library and doesn't yet talk HTTP/1.1, so use a modern browser).
+<https://www.httptwo.com/second-transfer/>.
 
 The library
 
   * Is concurrent, meaning that you can use amazing Haskell lightweight threads to 
     process the requests. 
 
-  * Obeys HTTP/2 flow control aspects.
+  * Obeys HTTP/2 flow control aspects, when talking HTTP/2.
 
   * And gives you freedom to (ab)use the HTTP/2 protocol in all the ways envisioned 
     by the standard. In particular you should be able to process streaming requests 
     (long uploads in POST or PUT requests) and to deliver streaming responses. You
     should even be able to do both simultaneously. 
 
-Setting up TLS for HTTP/2 correctly is enough of a shore, so I have bundled here the
+Setting up TLS for HTTP/2 correctly is a shore, so I have bundled here the
 TLS setup logic. Before you read any further, ATTENTION: enable always the threaded 
 ghc runtime in your final programs if you want TLS to work.
 
 
-
 Here is how you create a very basic HTTP/2 webserver:
 
 @
@@ -46,8 +45,9 @@
     , DataAndConclusion
     , tlsServeWithALPN
     , http2Attendant
+    , http11Attendant
     )
-import SecondTransfer.Http2(
+import SecondTransfer.Sessions(
       makeSessionsContext
     , defaultSessionsConfig
     )
@@ -84,14 +84,17 @@
     sessions_context <- makeSessionsContext defaultSessionsConfig
     let 
         http2_attendant = http2Attendant sessions_context helloWorldWorker
+        http11_attendant = http11Attendant sessions_context helloWorldWorker
     tlsServeWithALPN
         "tests\/support\/servercert.pem"   -- Server certificate
         "tests\/support\/privkey.pem"      -- Certificate private key
         "127.0.0.1"                      -- On which interface to bind
         [
-            ("h2-14", http2_attendant),  -- Protocols present in the ALPN negotiation
-            ("h2",    http2_attendant)   -- they may be slightly different, but for this 
-                                         -- test it doesn't matter.
+            ("h2-14", http2_attendant),    -- Protocols present in the ALPN negotiation
+            ("h2",    http2_attendant),    -- they may be slightly different, but for this 
+                                           -- test it doesn't matter.
+
+            ("http/1.1", http11_attendant) -- Let's talk HTTP/1.1 if everything else fails.
         ]
         8000 
 @
@@ -120,12 +123,12 @@
     -- * Types related to coherent workers
     --
     -- | A coherent worker is an abstraction that can dance at the 
-    --   tune of  HTTP/2. That is, it should be able to take
-    --   headers request first, and then a source of data coming in the 
+    --   tune of  HTTP/2 and HTTP/1.1. That is, it should be able to take
+    --   headers from a request first, then a source of data coming in the 
     --   request (for example, POST data). Even before exhausting the source, 
-    --   the coherent worker can post the response headers, and then create 
+    --   the coherent worker can post the response headers and
     --   its source for the response data. A coherent worker can also present
-    --   create streams to push to the client. 
+    --   streams to push to the client. 
 	  Headers
     , HeaderName
     , HeaderValue
@@ -140,22 +143,10 @@
     , InputDataStream
     , FinalizationHeaders
     
-    -- * Basic utilities for  HTTP/2 servers
-    -- ** Configuration 
-    
-    -- ** Callback types
+    -- ** How to couple bidirectional data channels to sessions
     ,Attendant
-    -- *** Push, Pull and Close actions
-    -- 
-    -- | You don't need to do anything with these types if you are using
-    --   `http2Attendant` and `tlsServeWithALPN`. But they are useful if 
-    --   you want to implement your own layer.
-    ,PullAction
-    ,PushAction
-    ,CloseAction
+    ,http11Attendant
     ,http2Attendant
-    ,IOProblem
-    ,GenericIOProblem
     -- * High level OpenSSL functions. 
     -- 
     -- | Use these functions to create your TLS-compliant 
@@ -176,6 +167,8 @@
     ,enableConsoleLogging
 	) where 
 
-import SecondTransfer.MainLoop.CoherentWorker 
-import SecondTransfer.MainLoop
-import SecondTransfer.Http2.MakeAttendant(http2Attendant)
+import           SecondTransfer.Http1                   (http11Attendant)
+import           SecondTransfer.Http2.MakeAttendant     (http2Attendant)
+import           SecondTransfer.MainLoop
+import           SecondTransfer.MainLoop.CoherentWorker
+import           SecondTransfer.Types
diff --git a/hs-src/SecondTransfer/Exception.hs b/hs-src/SecondTransfer/Exception.hs
--- a/hs-src/SecondTransfer/Exception.hs
+++ b/hs-src/SecondTransfer/Exception.hs
@@ -1,15 +1,27 @@
 {-# LANGUAGE DeriveDataTypeable, ExistentialQuantification #-}
+{-|
+Module      : SecondTransfer.Exception
+-}
 module SecondTransfer.Exception (
 	-- * Exceptions thrown by the HTTP/2 sessions
 	HTTP2SessionException (..)
 	,FramerException (..)
 	,BadPrefaceException (..)
+    ,HTTP11Exception (..)
+    ,HTTP11SyntaxException (..)
+    ,ContentLengthMissingException (..)
+
+    -- * Exceptions related to the IO layer
+    ,IOProblem(..)
+    ,GenericIOProblem(..)
+    ,StreamCancelledException(..)
 	) where 
 
 import           Control.Exception
 import           Data.Typeable
 
 
+
 -- | Abstract exception. All HTTP/2 exceptions derive from here 
 data HTTP2SessionException = forall e . Exception e => HTTP2SessionException e
     deriving Typeable
@@ -58,3 +70,77 @@
 instance Exception BadPrefaceException where
     toException   = convertFramerExceptionToException
     fromException = getFramerExceptionFromException
+
+
+-- | Abstract exception. All HTTP/1.1 related exceptions derive from here.
+--   Notice that this includes a lot of logical errors and they can be
+--   raised when handling HTTP/2 sessions also
+data HTTP11Exception = forall e . Exception e => HTTP11Exception e
+    deriving Typeable
+
+instance Show HTTP11Exception where
+    show (HTTP11Exception e) = show e
+
+instance  Exception HTTP11Exception 
+
+convertHTTP11ExceptionToException :: Exception e => e -> SomeException
+convertHTTP11ExceptionToException = toException . HTTP11Exception
+
+getHTTP11ExceptionFromException :: Exception e => SomeException -> Maybe e
+getHTTP11ExceptionFromException x = do
+    HTTP2SessionException a <- fromException x
+    cast a
+
+-- | Thrown with HTTP/1.1 over HTTP/1.1 sessions when the response body
+--   or the request body doesn't include a Content-Length header field,
+--   even if it should have included it 
+data ContentLengthMissingException = ContentLengthMissingException 
+    deriving (Typeable, Show)
+
+instance Exception ContentLengthMissingException where 
+    toException = convertHTTP11ExceptionToException
+    fromException = getHTTP11ExceptionFromException
+
+
+data HTTP11SyntaxException = HTTP11SyntaxException String 
+    deriving (Typeable, Show)
+
+instance Exception HTTP11SyntaxException where 
+    toException = convertHTTP11ExceptionToException
+    fromException = getHTTP11ExceptionFromException
+
+-- | Throw exceptions derived from this (e.g, `GenericIOProblem` below)
+--   to have the HTTP/2 session to terminate gracefully. 
+data IOProblem = forall e . Exception e => IOProblem e 
+    deriving Typeable
+
+
+instance  Show IOProblem where
+    show (IOProblem e) = show e 
+
+instance Exception IOProblem 
+
+-- | A concrete case of the above exception. Throw one of this
+--   if you don't want to implement your own type. Use 
+--   `IOProblem` in catch signatures.
+data GenericIOProblem = GenericIOProblem
+    deriving (Show, Typeable)
+
+
+instance Exception GenericIOProblem where 
+    toException = toException . IOProblem
+    fromException x = do 
+        IOProblem a <- fromException x 
+        cast a
+
+
+-- | This exception will be raised inside a `CoherentWorker` when the underlying 
+-- stream is cancelled (STREAM_RESET in HTTP\/2). Do any necessary cleanup
+-- in a handler, or simply use the fact that the exception is asynchronously
+-- delivered 
+-- to your CoherentWorker Haskell thread, giving you an opportunity to 
+-- interrupt any blocked operations.
+data StreamCancelledException = StreamCancelledException
+    deriving (Show, Typeable)
+
+instance Exception StreamCancelledException
diff --git a/hs-src/SecondTransfer/Http1.hs b/hs-src/SecondTransfer/Http1.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Http1.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
+
+module SecondTransfer.Http1(
+    http11Attendant
+    ) where 
+
+import SecondTransfer.Http1.Session         (http11Attendant)
diff --git a/hs-src/SecondTransfer/Http1/Parse.hs b/hs-src/SecondTransfer/Http1/Parse.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Http1/Parse.hs
@@ -0,0 +1,474 @@
+{-# OPTIONS_HADDOCK hide #-}
+{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
+
+module SecondTransfer.Http1.Parse(
+    newIncrementalHttp1Parser
+    ,addBytes
+
+    -- Internal exports, used by the test suite
+    ,locateCRLFs
+    ,splitByColon
+    ,stripBs
+    ,headerListToHTTP11Text
+    ,serializeHTTPResponse
+
+    ,IncrementalHttp1Parser
+    ,Http1ParserCompletion(..)
+    ,BodyStopCondition(..)
+    ) where 
+
+
+
+import           Control.Exception                      (throw)
+-- import           Control.Lens
+import qualified Control.Lens                           as L
+import           Control.Applicative
+
+import qualified Data.ByteString                        as B
+import           Data.List                              (foldl')
+import qualified Data.ByteString.Builder                as Bu
+import           Data.ByteString.Char8                  (pack, unpack)
+import qualified Data.ByteString.Char8                  as Ch8
+import qualified Data.ByteString.Lazy                   as Lb
+import           Data.Char                              (toLower)
+import           Data.Maybe                             (isJust)
+import           Data.Monoid                            (mappend,
+                                                         mempty,
+                                                         mconcat)
+import qualified Data.Attoparsec.ByteString             as Ap
+
+import           Data.Foldable                          (find)
+import           Data.Word                              (Word8)
+import qualified Data.Map                               as M
+
+import qualified SecondTransfer.Utils.HTTPHeaders       as E
+import           SecondTransfer.Exception
+import           SecondTransfer.MainLoop.CoherentWorker (Headers)
+import           SecondTransfer.Utils                   (subByteString)
+
+
+
+
+data IncrementalHttp1Parser = IncrementalHttp1Parser {
+    _fullText :: Bu.Builder
+    ,_stateParser :: HeaderParseClosure
+    }
+
+type HeaderParseClosure = (B.ByteString ->  ([Int], Int, Word8))
+
+-- L.makeLenses ''IncrementalHttp1Parser
+
+instance Show IncrementalHttp1Parser where 
+    show (IncrementalHttp1Parser ft _sp ) = show $ Bu.toLazyByteString ft
+
+
+newIncrementalHttp1Parser :: IncrementalHttp1Parser
+newIncrementalHttp1Parser = IncrementalHttp1Parser {
+    _fullText = mempty
+    ,_stateParser = locateCRLFs 0 [] 0
+    }
+
+
+-- | Was the parser complete?
+data Http1ParserCompletion = 
+    -- | No, not even headers are done. Use the returned
+    --   value to continue
+    MustContinue_H1PC IncrementalHttp1Parser
+    -- | Headers were completed. For some HTTP methods that's all
+    --   there is, and that's what this case represents. The second
+    --   argument is a left-overs string.
+    |OnlyHeaders_H1PC      Headers B.ByteString
+    -- | For requests with a body. The second argument is a condition
+    --   to stop receiving the body, the third is leftovers from 
+    --   parsing the headers.
+    |HeadersAndBody_H1PC   Headers BodyStopCondition B.ByteString
+    -- | Some requests are mal-formed. We can check those cases 
+    --   here.
+    |RequestIsMalformed_H1PC 
+    deriving Show
+
+
+-- | Stop condition when parsing the body. Right now only length 
+--   is supported, given with Content-Length. 
+--
+--  TODO: Support "chunked" transfer encoding for classical 
+--  HTTP/1.1, uploads will need it.
+data BodyStopCondition = 
+     UseBodyLength_BSC Int 
+     deriving (Show, Eq)
+
+
+data RequestOrResponseLine = 
+    -- First argument is the URI, second the method
+    Request_RoRL B.ByteString B.ByteString
+    -- First argument is the status code
+    |Response_RoRL Int
+    deriving (Show, Eq)
+
+    
+addBytes :: IncrementalHttp1Parser -> B.ByteString -> Http1ParserCompletion
+addBytes (IncrementalHttp1Parser full_text header_parse_closure) new_bytes =
+  let -- Just feed the bytes
+    (positions, length_so_far, last_char ) = header_parse_closure new_bytes
+    new_full_text = full_text `mappend` (Bu.byteString new_bytes)
+    could_finish = twoCRLFsAreConsecutive positions 
+  in 
+    case could_finish of 
+        Just at_position -> elaborateHeaders new_full_text positions at_position
+
+        Nothing -> MustContinue_H1PC 
+                    $ IncrementalHttp1Parser 
+                        new_full_text 
+                        (locateCRLFs length_so_far positions last_char)
+
+
+elaborateHeaders :: Bu.Builder -> [Int] -> Int -> Http1ParserCompletion
+elaborateHeaders full_text crlf_positions last_headers_position = 
+  let 
+    -- Start by getting a full byte-string representation of the headers,
+    -- no need to be silly with chunks.
+    full_headers_text = Lb.toStrict $ Bu.toLazyByteString full_text
+
+    -- Filter out CRLF pairs corresponding to multiline headers.
+    no_cont_positions_reverse = filter 
+        (\ pos -> if pos >= last_headers_position then True else 
+            not . isWsCh8 $
+                (Ch8.index 
+                    full_headers_text
+                    (pos + 2)
+                )
+        )
+        crlf_positions
+
+    no_cont_positions = reverse . tail $ no_cont_positions_reverse
+
+    -- Now get the headers as slices from the original string.
+    headers_pre = map 
+        (\ (start, stop) -> 
+            subByteString start stop full_headers_text
+        )
+        (zip
+            ((:)
+                0
+                (map 
+                    ( + 2 )
+                    no_cont_positions
+                )
+            )
+            no_cont_positions
+        )
+
+    -- TODO: We must reject header names ending in space.
+    headers_0 = map splitByColon $ tail headers_pre
+
+    -- The first line is not actually a header, but contains the method, the version
+    -- and the URI
+    request_or_response = parseFirstLine (head headers_pre)
+
+    headers_1 = headers_0
+
+    (headers_2, has_body) = case request_or_response of 
+
+        Request_RoRL uri method -> 
+          let
+            -- No lowercase, methods are case sensitive
+            -- lc_method = bsToLower method
+            has_body' = case method of 
+                "POST"   -> True 
+                "PUT"    -> True 
+                _        -> False
+          in 
+            ( (":path", uri):(":method",method):headers_1, has_body' )
+
+        Response_RoRL status -> 
+          let 
+            status_str = pack . show $ status 
+            excludes_body = 
+                ( (Ch8.head status_str) == '1')
+                ||
+                ( status == 204 || status == 304)
+          in
+            ((":status", status_str): headers_1, not excludes_body)
+
+    -- Still we need to lower-case header names, and trim them
+    headers_3 = [
+        ( (stripBs . bsToLower $ hn), stripBs hv ) | (hn, hv) <- headers_2
+        ]
+
+    content_length :: Int 
+    content_length = 
+      let
+        cnt_length_header = find (\ x -> (fst x) == "content-length" ) headers_3
+      in case cnt_length_header of 
+        Just (_, hv) -> read . unpack $ hv 
+        Nothing -> throw ContentLengthMissingException
+
+    leftovers = B.drop (last_headers_position + 4) full_headers_text
+  in 
+    if has_body 
+      then 
+        HeadersAndBody_H1PC headers_3 (UseBodyLength_BSC content_length) leftovers
+      else 
+        OnlyHeaders_H1PC headers_3 leftovers
+
+
+splitByColon :: B.ByteString -> (B.ByteString, B.ByteString)
+splitByColon  = L.over L._2 (B.tail) . Ch8.break (== ':') 
+
+
+parseFirstLine :: B.ByteString -> RequestOrResponseLine
+parseFirstLine s = 
+  let 
+    either_error_or_rrl = Ap.parseOnly httpFirstLine s 
+    exc = HTTP11SyntaxException "BadMessageFirstLine"
+  in 
+    case either_error_or_rrl of 
+        Left _ -> throw exc 
+        Right rrl -> rrl
+
+bsToLower :: B.ByteString -> B.ByteString
+bsToLower = Ch8.map toLower 
+
+
+-- This ought to be slow!
+stripBs :: B.ByteString -> B.ByteString
+stripBs s = 
+    fst 
+    .
+    last
+    $
+    takeWhile 
+        ( \ (_, ch) -> isWsCh8 ch )
+    $
+        iterate 
+        ( \ (bs, _) -> 
+                case Ch8.unsnoc bs of 
+                    Just (newbs, w8) -> (newbs, w8)
+                    Nothing -> ("", 'n')
+        )
+        (Ch8.dropWhile isWsCh8 s, ' ')
+
+
+locateCRLFs :: Int -> [Int] -> Word8 ->  B.ByteString ->  ([Int], Int, Word8)
+locateCRLFs initial_offset other_positions prev_last_char next_chunk =
+  let 
+    (last_char, positions_list, strlen) =
+        B.foldl 
+            (\ (prev_char, lst, i) w8 -> 
+                let 
+                    j = i + 1
+                in case (prev_char, w8) of 
+                    (13,10) -> (w8, (i-1):lst, j)
+                    _       -> (w8, lst,   j)
+            )
+            (prev_last_char, other_positions, initial_offset)
+            next_chunk
+  in (positions_list, strlen, last_char)
+
+
+twoCRLFsAreConsecutive :: [Int] -> Maybe Int 
+twoCRLFsAreConsecutive (p2:p1:_) | p2 - p1 == 2 = Just p1
+twoCRLFsAreConsecutive _                        = Nothing
+
+
+isWsCh8 :: Char -> Bool
+isWsCh8 s = isJust (Ch8.elemIndex
+        s
+        " \t"
+    )
+
+isWs :: Word8 -> Bool
+isWs s = isJust (B.elemIndex
+        s
+        " \t"
+    )
+
+http1Token :: Ap.Parser B.ByteString
+http1Token = Ap.string "HTTP/1.1" <|> Ap.string "HTTP/1.0"
+
+http1Method :: Ap.Parser B.ByteString
+http1Method = 
+    Ap.string "GET"
+    <|> Ap.string "POST"
+    <|> Ap.string "HEAD"
+    <|> Ap.string "PUT"
+    <|> Ap.string "OPTIONS"
+    <|> Ap.string "TRACE"
+    <|> Ap.string "CONNECT"
+
+unspacedUri :: Ap.Parser B.ByteString
+unspacedUri = Ap.takeWhile (not . isWs)
+
+
+space :: Ap.Parser Word8
+space = Ap.word8 32
+
+requestLine :: Ap.Parser RequestOrResponseLine
+requestLine = 
+    flip Request_RoRL
+    <$> 
+    http1Method 
+    <* space
+    <*>
+    unspacedUri 
+    <* space
+    <* http1Token
+
+digit :: Ap.Parser Word8
+digit = Ap.satisfy (Ap.inClass "0-9")
+
+responseLine :: Ap.Parser RequestOrResponseLine
+responseLine = 
+    (pure Response_RoRL)
+    <*
+    http1Token
+    <*
+    space
+    <*>
+    ( read . map (toEnum . fromIntegral )  <$> Ap.count 3 digit )
+    <*
+    space 
+    <*
+    Ap.takeByteString
+
+httpFirstLine :: Ap.Parser RequestOrResponseLine
+httpFirstLine = requestLine <|> responseLine
+
+
+headerListToHTTP11Text :: Headers -> Bu.Builder
+headerListToHTTP11Text headers = 
+    case headers of 
+        -- According to the specs, :status can be only 
+        -- the first header
+        (hn,hv): rest | hn == ":status" ->
+            (
+                (first_line . read . unpack $ hv)
+                `mappend`
+                (go rest)
+            )
+
+        rest -> 
+            (
+                (first_line 200)
+                `mappend`
+                (go rest)
+            )
+  where 
+    go [] = mempty
+    go ((hn,hv):rest) = 
+        (Bu.byteString hn) `mappend` ":" `mappend` " " `mappend` (Bu.byteString hv) 
+                           `mappend` "\r\n" `mappend` (go rest)
+
+    first_line :: Int -> Bu.Builder
+    first_line code = mconcat [
+        (Bu.byteString "HTTP/1.1"), " ",
+        (Bu.string7 . show $ code), " ",
+        (M.findWithDefault "OK" code httpStatusTable),
+        "\r\n"
+        ]
+
+
+
+serializeHTTPResponse :: Headers -> [B.ByteString] -> Lb.ByteString
+serializeHTTPResponse response_headers fragments = 
+  let
+    -- So got some data in an answer. Now there are three ways to go about 
+    -- the returned data: to force a chunked transfer-encoding, to read all
+    -- the data and add/set the Content-Length header, or to let the user 
+    -- decide which one she prefers.
+    --
+    -- Right now I'm going for the second one, until somebody complains
+    -- This is equivalent to a lazy byte-string...but I just need the 
+    -- length 
+    -- I promised to minimize the number of interventions of the library,
+    -- so it could be a good idea to remove this one further down the 
+    -- road. 
+    h2 = E.lowercaseHeaders response_headers
+    data_size = foldl' (\ n bs -> n + B.length bs) 0 fragments
+    headers_editor = E.fromList h2
+    content_length_header_lens = E.headerLens "content-length"
+    he2 = L.set 
+        content_length_header_lens 
+        (Just (pack . show $ data_size)) 
+        headers_editor 
+    h3 = E.toList he2
+    -- Next, I must serialize the headers....
+    headers_text_as_builder = headerListToHTTP11Text h3
+
+    -- We dump the headers first... unfortunately when talking 
+    -- HTTP/1.1 the most efficient way to write those bytes is 
+    -- to create a big buffer and pass it on to OpenSSL.
+    -- However the Builder generating the headers above says 
+    -- it generates fragments between 4k and 32 kb, I checked it
+    -- and it is true, so we can use it
+
+    -- Now we need to insert an extra \r\n, even it the response is 
+    -- empty
+
+    -- And then we use the builder to re-format the fragments returned
+    -- by the coherent worker 
+    -- TODO: This could be a good place to introduce chunked responses.
+    body_builder = mconcat $ map Bu.byteString fragments
+
+
+
+  in Bu.toLazyByteString $ headers_text_as_builder `mappend` "\r\n" `mappend`
+                    body_builder
+
+
+httpStatusTable :: M.Map Int Bu.Builder
+httpStatusTable = M.fromList
+    [
+        (100, "Continue"),
+        (101, "Switching Protocols"),
+        (200, "OK"),
+        (201, "Created"),
+        (202, "Accepted"),
+        (203, "Non-Authoritative Information"),
+        (204, "No Content"),
+        (205, "Reset Content"),
+        (206, "Partial Content"),
+        (300, "Multiple Choices"),
+        (301, "Moved Permanently"),
+        (302, "Found"),
+        (303, "See Other"),
+        (304, "Not Modified"),
+        (305, "Use Proxy"),
+        (307, "Temporary Redirect"),
+        (400, "Bad Request"),
+        (401, "Unauthorized"),
+        (402, "Payment Required"),
+        (403, "Forbidden"),
+        (404, "Not Found"),
+        (405, "Method Not Allowed"),
+        (406, "Not Acceptable"),
+        (407, "Proxy Authentication Required"),
+        (408, "Request Timeout"),
+        (409, "Conflict"),
+        (410, "Gone"),
+        (411, "Length Required"),
+        (412, "Precondition Failed"),
+        (413, "Request Entity Too Large"),
+        (414, "Request-URI Too Long"),
+        (415, "Unsupported Media Type"),
+        (416, "Requested Range Not Satisfiable"),
+        (417, "Expectation Failed"),
+        (500, "Internal Server Error"),
+        (501, "Not Implemented"),
+        (502, "Bad Gateway"),
+        (503, "Service Unavailable"),
+        (504, "Gateway Timeout"),
+        (505, "HTTP Version Not Supported")
+    ]
+
+-- For testing purposes... --------------------------------------------------------------
+-----------------------------------------------------------------------------------------
+
+-- assertEqual :: Eq a => String -> a -> a -> IO ()
+-- assertEqual label v1 v2 = do 
+--     putStrLn label
+--     if v1 == v2 
+--       then 
+--         putStrLn "Ok"
+--       else 
+--         putStrLn "NoOk"
diff --git a/hs-src/SecondTransfer/Http1/Session.cpphs b/hs-src/SecondTransfer/Http1/Session.cpphs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Http1/Session.cpphs
@@ -0,0 +1,108 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_HADDOCK hide #-}
+module SecondTransfer.Http1.Session(
+    http11Attendant
+    ) where 
+
+ 
+-- import qualified Control.Lens                           as L
+-- import           Control.Lens                           ( (^.) )
+import           Control.Exception                     (catch)
+import           Control.Concurrent                    (forkIO)
+
+import qualified Data.ByteString                        as B
+-- import qualified Data.ByteString.Lazy                   as LB
+-- import           Data.ByteString.Char8                  (unpack)
+-- import qualified Data.ByteString.Builder                as Bu
+import           Data.Conduit
+import           Data.Conduit.List                      (consume)
+-- import           Data.Monoid                            (mconcat, mappend)
+
+import           SecondTransfer.MainLoop.CoherentWorker (CoherentWorker,)
+import           SecondTransfer.MainLoop.PushPullType   (Attendant)
+import           SecondTransfer.Sessions.Internal       (SessionsContext, acquireNewSessionTag)
+
+-- Logging utilities
+import           System.Log.Logger                      
+
+import           SecondTransfer.Http1.Parse
+import           SecondTransfer.Exception                (IOProblem)
+
+-- import           Debug.Trace                             (traceShow)
+
+
+-- | Session attendant that speaks HTTP/1.1
+-- 
+http11Attendant :: SessionsContext -> CoherentWorker -> Attendant
+http11Attendant sessions_context coherent_worker 
+                push_action pull_action close_action 
+    = do 
+        new_session_tag <- acquireNewSessionTag sessions_context
+        infoM "Session.Session_HTTP11" $ "Starting new session with tag: " ++(show new_session_tag)
+        forkIO $ go new_session_tag (Just "")
+        return ()
+  where 
+    go :: Int -> Maybe B.ByteString -> IO ()
+    go session_tag (Just leftovers) = do 
+        infoM "Session.Session_HTTP11" $ "(Re)Using session with tag: " ++(show session_tag)
+        maybe_leftovers <- add_data newIncrementalHttp1Parser leftovers session_tag
+        go session_tag maybe_leftovers
+
+    go _ Nothing = 
+        return ()
+
+    add_data :: IncrementalHttp1Parser  -> B.ByteString -> Int -> IO (Maybe B.ByteString)
+    add_data parser bytes session_tag = do 
+        let 
+            completion = addBytes parser bytes 
+            -- completion = addBytes parser $ traceShow ("At session " ++ (show session_tag) ++ " Received: " ++ (unpack bytes) ) bytes
+        case completion of 
+
+            MustContinue_H1PC new_parser -> do 
+                -- print "MustContinue_H1PC"
+                catch 
+                    (do
+                        new_bytes <- pull_action
+                        r <- add_data new_parser new_bytes session_tag
+                        return r
+                    )
+                    ( (\ _e -> do
+                        -- This is a pretty harmless condition that happens 
+                        -- often when the remote peer closes the connection
+                        debugM "Session.HTTP1" "Could not receive data"
+                        close_action
+                        return Nothing
+                    ) :: IOProblem -> IO (Maybe B.ByteString) )
+
+                
+
+            OnlyHeaders_H1PC headers leftovers -> do 
+                -- print "OnlyHeaders_H1PC"
+                -- Ready for action...
+                -- ATTENTION: Not use for pushed streams here....
+                -- We must decide what to do if the user return those
+                -- anyway.
+                (response_headers, _, data_and_conclusion) <- coherent_worker (headers, Nothing)
+                (_, fragments) <- runConduit $ fuseBoth data_and_conclusion consume 
+                let 
+                    response_text =
+                        serializeHTTPResponse response_headers fragments
+
+                catch 
+                    (do
+                        push_action response_text
+                        return $ Just leftovers
+                    )
+                    ((\ _e -> do
+                        debugM "Session.HTTP1" "Session abandoned"
+                        close_action
+                        return Nothing
+                    ) :: IOProblem -> IO (Maybe B.ByteString) )
+
+            HeadersAndBody_H1PC _headers _stopcondition _recv_leftovers -> do
+                -- print "HeadersAndBody_H1PC"
+                -- Let's see if I can go through the basic movements first, then through 
+                -- more complicated things.
+                -- TODO: Implement posts and other requests with bodies....
+                close_action
+                error "NotImplemented requests with bodies"
diff --git a/hs-src/SecondTransfer/Http2.hs b/hs-src/SecondTransfer/Http2.hs
--- a/hs-src/SecondTransfer/Http2.hs
+++ b/hs-src/SecondTransfer/Http2.hs
@@ -1,31 +1,8 @@
+{-|
+Module: SecondTransfer.Http2
+-}
 module SecondTransfer.Http2(
-	BadPrefaceException
-	,http2Attendant
-	,makeSessionsContext
-	,defaultSessionsConfig
-	-- | Configuration information
-	,SessionsConfig(..)
-	-- | Context. You need to use `makeSessionsContext` to instance
-	--   one of this. 
-	,SessionsContext
-	,SessionsCallbacks(..)
-	,ErrorCallback
-	,sessionsCallbacks
-
-	,reportErrorCallback
-	-- | Lens to access the error callback.
+	http2Attendant
 	) where
 
 import SecondTransfer.Http2.MakeAttendant(http2Attendant)
-import SecondTransfer.Http2.Framer(BadPrefaceException)
-import SecondTransfer.Http2.Session(
-	defaultSessionsConfig,
-	makeSessionsContext,
-
-	SessionsConfig(..),
-	SessionsContext,
-	SessionsCallbacks,
-	ErrorCallback,
-	sessionsCallbacks,
-	reportErrorCallback
-	)
diff --git a/hs-src/SecondTransfer/Http2/Framer.cpphs b/hs-src/SecondTransfer/Http2/Framer.cpphs
--- a/hs-src/SecondTransfer/Http2/Framer.cpphs
+++ b/hs-src/SecondTransfer/Http2/Framer.cpphs
@@ -36,11 +36,12 @@
 
 import qualified Data.HashTable.IO                      as H
 
+import           SecondTransfer.Sessions.Internal       (sessionExceptionHandler, nextSessionId, SessionsContext)
 import           SecondTransfer.Http2.Session           
 import           SecondTransfer.MainLoop.CoherentWorker (CoherentWorker)
 import qualified SecondTransfer.MainLoop.Framer         as F
 import           SecondTransfer.MainLoop.PushPullType   (Attendant, CloseAction,
-                                                         PullAction, PushAction, IOProblem)
+                                                         PullAction, PushAction)
 import           SecondTransfer.Utils                   (Word24, word24ToInt)
 import           SecondTransfer.Exception
 
@@ -155,7 +156,7 @@
         exc_handler :: Int -> SessionsContext -> FramerException -> IO ()
         exc_handler x y e = do
             modifyMVar_ output_is_forbidden (\ _ -> return True) 
-            sessionExceptionHandler Framer_SessionComponent x y e
+            sessionExceptionHandler Framer_HTTP2SessionComponent x y e
 
 
     forkIO 
@@ -424,7 +425,7 @@
         exc_handler x y e = do
             -- Let's also decree that other streams don't even try
             modifyMVar_ output_is_forbidden_mvar ( \ _ -> return True)
-            sessionExceptionHandler Framer_SessionComponent x y e
+            sessionExceptionHandler Framer_HTTP2SessionComponent x y e
 
 
     read_state <- ask 
diff --git a/hs-src/SecondTransfer/Http2/MakeAttendant.hs b/hs-src/SecondTransfer/Http2/MakeAttendant.hs
--- a/hs-src/SecondTransfer/Http2/MakeAttendant.hs
+++ b/hs-src/SecondTransfer/Http2/MakeAttendant.hs
@@ -5,7 +5,7 @@
 
 
 import           SecondTransfer.Http2.Framer            (wrapSession)
-import           SecondTransfer.Http2.Session           (SessionsContext)
+import           SecondTransfer.Sessions.Internal       (SessionsContext)
 import           SecondTransfer.MainLoop.CoherentWorker
 import           SecondTransfer.MainLoop.PushPullType   (
 														 --CloseAction,
diff --git a/hs-src/SecondTransfer/Http2/Session.cpphs b/hs-src/SecondTransfer/Http2/Session.cpphs
--- a/hs-src/SecondTransfer/Http2/Session.cpphs
+++ b/hs-src/SecondTransfer/Http2/Session.cpphs
@@ -8,21 +8,12 @@
     ,getFrameFromSession
     ,sendFrameToSession
     ,sendCommandToSession
-    ,defaultSessionsConfig
-    ,sessionId
-    ,reportErrorCallback
-    ,sessionsCallbacks
-    ,nextSessionId
-    ,makeSessionsContext
-    ,sessionsConfig
-    ,sessionExceptionHandler
 
     ,CoherentSession
     ,SessionInput(..)
     ,SessionInputCommand(..)
     ,SessionOutput(..)
     ,SessionOutputCommand(..)
-    ,SessionsContext(..)
     ,SessionCoordinates(..)
     ,SessionComponent(..)
     ,SessionsCallbacks(..)
@@ -39,7 +30,7 @@
 -- System grade utilities
 import           Control.Concurrent                     (ThreadId, forkIO)
 import           Control.Concurrent.Chan
-import           Control.Exception                      (SomeException, throwTo)
+import           Control.Exception                      (throwTo)
 import qualified Control.Exception                      as E
 import           Control.Monad                          (forever)
 import           Control.Monad.IO.Class                 (liftIO)
@@ -66,6 +57,8 @@
 -- Imports from other parts of the program
 import           SecondTransfer.MainLoop.CoherentWorker
 import           SecondTransfer.MainLoop.Tokens
+import           SecondTransfer.Sessions.Config
+import           SecondTransfer.Sessions.Internal       (sessionExceptionHandler, SessionsContext)
 import           SecondTransfer.Utils                   (unfoldChannelAndSource)
 import           SecondTransfer.Exception
 
@@ -109,7 +102,7 @@
 makeLenses ''WorkerThreadEnvironment
 
 
--- Basically a couple of channels ... 
+-- An HTTP/2 session. Basically a couple of channels ... 
 type Session = (SessionInput, SessionOutput)
 
 
@@ -151,79 +144,6 @@
   deriving Show
 
 
--- | Information used to identify a particular session. 
-newtype SessionCoordinates = SessionCoordinates  Int
-    deriving Show
-
-instance Eq SessionCoordinates where 
-    (SessionCoordinates a) == (SessionCoordinates b) =  a == b
-
--- | Get/set a numeric Id from a `SessionCoordinates`. For example, to 
---   get the session id with this, import `Control.Lens.(^.)` and then do 
---
--- @
---      session_id = session_coordinates ^. sessionId
--- @
--- 
-sessionId :: Functor f => (Int -> f Int) -> SessionCoordinates -> f SessionCoordinates
-sessionId f (SessionCoordinates session_id) = 
-    fmap (\ s' -> (SessionCoordinates s')) (f session_id)
-
-
-
--- | Components at an individual session. Used to report
---   where in the session an error was produced. This interface is likely 
---   to change in the future, as we add more metadata to exceptions
-data SessionComponent = 
-    SessionInputThread_SessionComponent 
-    |SessionHeadersOutputThread_SessionComponent
-    |SessionDataOutputThread_SessionComponent
-    |Framer_SessionComponent
-    deriving Show
-
-
--- | Used by this session engine to report an error at some component, in a particular
---   session. 
-type ErrorCallback = (SessionComponent, SessionCoordinates, SomeException) -> IO ()
-
--- | Callbacks that you can provide your sessions to notify you 
---   of interesting things happening in the server. 
-data SessionsCallbacks = SessionsCallbacks {
-    -- Callback used to report errors during this session
-    _reportErrorCallback :: Maybe ErrorCallback
-}
-
-makeLenses ''SessionsCallbacks
-
-
--- | Configuration information you can provide to the session maker.
-data SessionsConfig = SessionsConfig {
-    -- | Session callbacks
-    _sessionsCallbacks :: SessionsCallbacks
-}
-
--- makeLenses ''SessionsConfig
-
--- | Lens to access sessionsCallbacks in the `SessionsConfig` object.
-sessionsCallbacks :: Lens' SessionsConfig SessionsCallbacks
-sessionsCallbacks  f (
-    SessionsConfig {
-        _sessionsCallbacks= s 
-    }) = fmap (\ s' -> SessionsConfig {_sessionsCallbacks = s'}) (f s)
-
-
--- | Contains information that applies to all 
---   sessions created in the program. Use the lenses 
---   interface to access members of this struct. 
--- 
-data SessionsContext = SessionsContext {
-     _sessionsConfig  :: SessionsConfig
-    ,_nextSessionId   :: MVar Int
-    }
-
-
-makeLenses ''SessionsContext
-
 -- Here is how we make a session 
 type SessionMaker = SessionsContext -> IO Session
 
@@ -232,25 +152,6 @@
 type CoherentSession = CoherentWorker -> SessionMaker 
 
 
--- | Creates a default sessions context. Modify as needed using 
---   the lenses interfaces
-defaultSessionsConfig :: SessionsConfig
-defaultSessionsConfig = SessionsConfig {
-    _sessionsCallbacks = SessionsCallbacks {
-            _reportErrorCallback = Nothing
-        }
-    }
-
-
--- Adds runtime data to a context, and let it work.... 
-makeSessionsContext :: SessionsConfig -> IO SessionsContext
-makeSessionsContext sessions_config = do 
-    next_session_id_mvar <- newMVar 1 
-    return $ SessionsContext {
-        _sessionsConfig = sessions_config,
-        _nextSessionId = next_session_id_mvar
-        }
-
 data PostInputMechanism = PostInputMechanism (Chan (Maybe B.ByteString), InputDataStream)
 
 
@@ -291,6 +192,7 @@
     -- is cancelled by the client. This way we get early finalization. 
     ,_stream2WorkerThread        :: HashTable Int ThreadId
 
+    -- Use to retrieve/set the session id
     ,_sessionIdAtSession         :: Int
     }
 
@@ -356,15 +258,15 @@
         exc_guard component action = E.catch action $ exc_handler component
 
     -- Create an input thread that decodes frames...
-    forkIO $ exc_guard SessionInputThread_SessionComponent 
+    forkIO $ exc_guard SessionInputThread_HTTP2SessionComponent 
            $ runReaderT sessionInputThread session_data
  
     -- Create a thread that captures headers and sends them down the tube 
-    forkIO $ exc_guard SessionHeadersOutputThread_SessionComponent 
+    forkIO $ exc_guard SessionHeadersOutputThread_HTTP2SessionComponent 
            $ runReaderT (headersOutputThread headers_output session_output_mvar) session_data
 
     -- Create a thread that captures data and sends it down the tube
-    forkIO $ exc_guard SessionDataOutputThread_SessionComponent 
+    forkIO $ exc_guard SessionDataOutputThread_HTTP2SessionComponent 
            $ dataOutputThread data_output session_output_mvar
 
     -- The two previous threads fill the session_output argument below (they write to it)
@@ -459,10 +361,10 @@
                 
             continue 
 
-        Right frame@(NH2.Frame _ (NH2.RSTStreamFrame error_code_id)) -> do
+        Right frame@(NH2.Frame _ (NH2.RSTStreamFrame _error_code_id)) -> do
             let stream_id = streamIdFromFrame frame
             liftIO $ do 
-                INSTRUMENTATION( infoM "HTTP2.Session" $ "Stream reset: " ++ (show error_code_id) )
+                INSTRUMENTATION( infoM "HTTP2.Session" $ "Stream reset: " ++ (show _error_code_id) )
                 cancelled_streams <- takeMVar cancelled_streams_mvar
                 INSTRUMENTATION( infoM "HTTP2.Session" $ "Cancelled stream was: " ++ (show stream_id) )
                 putMVar cancelled_streams_mvar $ NS.insert  stream_id cancelled_streams
@@ -544,7 +446,7 @@
             -- Frame was received by the peer, do nothing here...
             continue 
 
-
+        -- TODO: Do something with these settings!!
         Right (NH2.Frame _ (NH2.SettingsFrame settings_list))  -> do 
             INSTRUMENTATION( liftIO $ debugM "HTTP2.Session" $ "Received settings: " ++ (show settings_list) )
             -- Just acknowledge the frame.... for now 
@@ -850,20 +752,3 @@
         ) fragments
 
 
-
-sessionExceptionHandler :: E.Exception e => SessionComponent -> Int -> SessionsContext -> e -> IO ()
-sessionExceptionHandler session_component session_id sessions_context e = do 
-    let
-        getit = ( sessionsConfig . sessionsCallbacks . reportErrorCallback ) 
-        maybe_error_callback = sessions_context ^. getit 
-        error_tuple = (
-            session_component,
-            SessionCoordinates session_id, 
-            E.toException e
-            )
-    case maybe_error_callback of 
-        Nothing -> 
-            errorM "HTTP2.Session" (show (e))
-
-        Just callback -> 
-            callback error_tuple
diff --git a/hs-src/SecondTransfer/MainLoop.hs b/hs-src/SecondTransfer/MainLoop.hs
--- a/hs-src/SecondTransfer/MainLoop.hs
+++ b/hs-src/SecondTransfer/MainLoop.hs
@@ -1,21 +1,9 @@
 module SecondTransfer.MainLoop (
-	-- * Callbacks
-	--
-	-- | These callback make possible to separate the parts in layers. 
-	--   The `Attendant` is a function that can push and pull bytes to/from
-	--   a transport (for example, a socket), but it is not concerned on how
-	--   those bytes are pushed or pulled. 
-	Attendant
-	,PullAction
-	,PushAction
-	,CloseAction
-	,IOProblem
-	,GenericIOProblem
 	-- * High level OpenSSL functions. 
 	-- 
 	-- | Use these functions to create your TLS-compliant 
 	--   HTTP/2 server in a snap.
-	,tlsServeWithALPN
+	tlsServeWithALPN
     ,tlsServeWithALPNAndFinishOnRequest
 
     ,enableConsoleLogging
@@ -24,11 +12,6 @@
     ,FinishRequest(..)
 	) where 
 
-
-import           SecondTransfer.MainLoop.PushPullType   (Attendant, PullAction,
-                                                         PushAction, CloseAction,
-                                                         IOProblem, GenericIOProblem
-                                                         )
 
 import           SecondTransfer.MainLoop.OpenSSL_TLS
 import           SecondTransfer.MainLoop.Logging         (enableConsoleLogging)
diff --git a/hs-src/SecondTransfer/MainLoop/CoherentWorker.hs b/hs-src/SecondTransfer/MainLoop/CoherentWorker.hs
--- a/hs-src/SecondTransfer/MainLoop/CoherentWorker.hs
+++ b/hs-src/SecondTransfer/MainLoop/CoherentWorker.hs
@@ -22,15 +22,14 @@
     , PushedStream
     , DataAndConclusion
     , InputDataStream
-    , StreamCancelledException (..)
     ) where 
 
-import           Control.Exception
+
 import qualified Data.ByteString   as B
 import           Data.Conduit
 import           Data.Foldable     (find)
-import           Data.Typeable
 
+
 -- | The name part of a header
 type HeaderName = B.ByteString
 
@@ -83,18 +82,12 @@
 --   starts arriving to the server. 
 type CoherentWorker = Request -> IO PrincipalStream
 
--- | This exception will be raised inside a `CoherentWorker` when the underlying 
--- stream is cancelled (STREAM_RESET in HTTP\/2). Do any necessary cleanup
--- in a handler, or simply use the fact that the exception is asynchronously
--- delivered 
--- to your CoherentWorker Haskell thread, giving you an opportunity to 
--- interrupt any blocked operations.
-data StreamCancelledException = StreamCancelledException
-    deriving (Show, Typeable)
 
-instance Exception StreamCancelledException
-
--- | A list of pushed streams 
+-- | A list of pushed streams. 
+--   Notice that a list of IO computations is required here. These computations
+--   only happen when and if the streams are pushed to the client. 
+--   The lazy nature of Haskell helps to avoid unneeded computations if the 
+--   streams are not going to be sent to the client.
 type PushedStreams = [ IO PushedStream ]
 
 -- | A pushed stream, represented by a list of request headers, 
diff --git a/hs-src/SecondTransfer/MainLoop/Framer.hs b/hs-src/SecondTransfer/MainLoop/Framer.hs
--- a/hs-src/SecondTransfer/MainLoop/Framer.hs
+++ b/hs-src/SecondTransfer/MainLoop/Framer.hs
@@ -14,6 +14,7 @@
                                            -- , liftIO
                                            )
 import qualified Data.ByteString           as B
+import qualified Data.ByteString.Builder   as Bu
 import qualified Data.ByteString.Lazy      as LB
 import           Data.Conduit
 
@@ -39,17 +40,13 @@
     -> Source m B.ByteString               -- ^ Packet and leftovers, if we could get them 
 readNextChunk length_callback input_leftovers gen = do 
     let 
+
         maybe_length = length_callback input_leftovers
-        readUpTo_ lo the_length | (B.length lo) >= the_length = 
-            return $ B.splitAt the_length lo
-        readUpTo_ lo the_length = do 
-            frag <- lift gen 
-            readUpTo_ (lo `mappend` frag) the_length
 
     case maybe_length of 
         Just the_length -> do 
             -- Just need to read the rest .... 
-            (package_bytes, newnewleftovers) <- readUpTo_ input_leftovers the_length
+            (package_bytes, newnewleftovers) <- lift $ readUpTo gen input_leftovers the_length
             yield package_bytes 
             readNextChunk length_callback newnewleftovers gen 
 
@@ -85,12 +82,18 @@
 
 
 readUpTo :: Monad m => m B.ByteString -> B.ByteString -> Int -> m (B.ByteString, B.ByteString)
-readUpTo _ lo the_length | (B.length lo) >= the_length = 
-    return $ B.splitAt the_length lo
-readUpTo gen lo the_length = do 
-    frag <- gen 
-    readUpTo gen (lo `mappend` frag) the_length
-
+readUpTo gen input_leftovers the_length = 
+  let 
+    initial_length = B.length input_leftovers
+    bu = Bu.byteString input_leftovers
+    go lo readsofar_length 
+        | readsofar_length >= the_length = 
+            return $ B.splitAt the_length $ LB.toStrict . Bu.toLazyByteString $ lo
+        | otherwise = do
+            frag <- gen 
+            go (lo `mappend` (Bu.byteString frag)) (readsofar_length + (B.length frag))
+  in 
+    go bu initial_length
 
 -- Some protocols, e.g., http/2, have the client transmit a fixed-length
 -- prefix. This function reads both that prefix and returns whatever get's
diff --git a/hs-src/SecondTransfer/MainLoop/Internal.hs b/hs-src/SecondTransfer/MainLoop/Internal.hs
--- a/hs-src/SecondTransfer/MainLoop/Internal.hs
+++ b/hs-src/SecondTransfer/MainLoop/Internal.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_HADDOCK hide #-}
 module SecondTransfer.MainLoop.Internal(
 	readNextChunkAndContinue
 	,http2FrameLength
diff --git a/hs-src/SecondTransfer/MainLoop/Logging.hs b/hs-src/SecondTransfer/MainLoop/Logging.hs
--- a/hs-src/SecondTransfer/MainLoop/Logging.hs
+++ b/hs-src/SecondTransfer/MainLoop/Logging.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_HADDOCK hide #-}
 module SecondTransfer.MainLoop.Logging (
 	-- | Simple, no fuss enable logging
 	enableConsoleLogging
@@ -36,7 +37,7 @@
 setLoggerLevels :: (LogHandler s) => s -> IO () 
 setLoggerLevels s = do
     updateGlobalLogger rootLoggerName removeHandler
-    updateGlobalLogger "HTTP2.Session" (
+    updateGlobalLogger "Session" (
         setHandlers [s] .  
         setLevel INFO  
         )
@@ -44,7 +45,11 @@
         setHandlers [s] .  
         setLevel DEBUG  
         )
-    updateGlobalLogger "HTTP2.Framer" (
+    updateGlobalLogger "HTTP1" (
+        setHandlers [s] . 
+        setLevel DEBUG
+        )
+    updateGlobalLogger "HTTP2" (
         setHandlers [s] . 
         setLevel DEBUG
         )
diff --git a/hs-src/SecondTransfer/MainLoop/OpenSSL_TLS.cpphs b/hs-src/SecondTransfer/MainLoop/OpenSSL_TLS.cpphs
--- a/hs-src/SecondTransfer/MainLoop/OpenSSL_TLS.cpphs
+++ b/hs-src/SecondTransfer/MainLoop/OpenSSL_TLS.cpphs
@@ -30,10 +30,11 @@
 import           System.Log.Logger
 
 import           SecondTransfer.MainLoop.PushPullType
+import           SecondTransfer.Exception
 
 #include "Logging.cpphs"
 
--- | Exception inheriting from `IOProblem`. This is thrown by the 
+-- | Exceptions inheriting from `IOProblem`. This is thrown by the 
 -- OpenSSL subsystem to signal that the connection was broken or that 
 -- otherwise there was a problem at the SSL layer. 
 data TLSLayerGenericProblem = TLSLayerGenericProblem String
@@ -130,6 +131,8 @@
 tlsServeWithALPN :: FilePath                -- ^ Path to a certificate the server is going to use to identify itself.
                                             --   Bear in mind that multiple domains can be served from the same HTTP/2 
                                             --   TLS socket, so please create the HTTP/2 certificate accordingly.
+                                            --   Also, currently this function only accepts paths to certificates 
+                                            --   or certificate chains in .pem format. 
                  -> FilePath                -- ^ Path to the key of your certificate. 
                  -> String                  -- ^ Name of the network interface where you want to start your server
                  -> [(String, Attendant)]   -- ^ List of protocol names and the corresponding `Attendant` to use for 
@@ -179,8 +182,9 @@
 
             case either_wired_ptr of 
 
-                Left msg -> do 
-                    INSTRUMENTATION( errorM "OpenSSL" $ ".. wait for connection failed. " ++ msg )
+-- Disable a warning
+                Left _msg -> do 
+                    INSTRUMENTATION( errorM "OpenSSL" $ ".. wait for connection failed. " ++ _msg )
                     return ()
 
                 Right wired_ptr -> do 
diff --git a/hs-src/SecondTransfer/MainLoop/PushPullType.hs b/hs-src/SecondTransfer/MainLoop/PushPullType.hs
--- a/hs-src/SecondTransfer/MainLoop/PushPullType.hs
+++ b/hs-src/SecondTransfer/MainLoop/PushPullType.hs
@@ -5,14 +5,9 @@
 	,PullAction
 	,Attendant
     ,CloseAction
-    ,IOProblem(..)
-    ,GenericIOProblem(..)
 	) where 
 
 
-import           Control.Exception 
-import           Data.Typeable                (Typeable, cast)
-
 import qualified Data.ByteString              as B
 import qualified Data.ByteString.Lazy         as LB
 
@@ -38,40 +33,19 @@
 
 -- | A function which takes three arguments: the first one says 
 --   how to send data (on a socket or similar transport), and the second one how 
---   to receive data on said socket. The third argument encapsulates 
+--   to receive data on the transport. The third argument encapsulates 
 --   the sequence of steps needed for a clean shutdown. 
 --
 --   You can implement one of these to let somebody else  supply the 
---   push, pull and close callbacks. In this library we supply callbacks
---   for TLS sockets, so that you don't need to go through the drudgery 
---   of managing those yourself.
+--   push, pull and close callbacks. For example, 'tlsServeWithALPN' will 
+--   supply these arguments to an 'Attendant'. 
 --
 --   Attendants encapsulate all the session book-keeping functionality,
---   which for HTTP/2 is quite complicated. You use the function `http2Attendant`
---   to create one of these from a `CoherentWorker`.
+--   which for HTTP/2 is quite complicated. You use the functions 
+--   http**Attendant
+--   to create one of these from a 'SecondTransfer.Types.CoherentWorker'.
+--
+--   This library supplies two of such Attendant factories,
+--   'SecondTransfer.Http1.http11Attendant' for 
+--   HTTP 1.1 sessions, and 'SecondTransfer.Http2.http2Attendant' for HTTP/2 sessions.
 type Attendant = PushAction -> PullAction -> CloseAction -> IO () 
-
-
--- | Throw exceptions derived from this (e.g, `GenericIOProblem` below)
---   to have the HTTP/2 session to terminate gracefully. 
-data IOProblem = forall e . Exception e => IOProblem e 
-	deriving Typeable
-
-
-instance  Show IOProblem where
-	show (IOProblem e) = show e 
-
-instance Exception IOProblem 
-
--- | A concrete case of the above exception. Throw one of this
---   if you don't want to implement your own type. Use 
---   `IOProblem` in catch signatures.
-data GenericIOProblem = GenericIOProblem
-	deriving (Show, Typeable)
-
-
-instance Exception GenericIOProblem where 
-	toException = toException . IOProblem
-	fromException x = do 
-		IOProblem a <- fromException x 
-		cast a
diff --git a/hs-src/SecondTransfer/Sessions.hs b/hs-src/SecondTransfer/Sessions.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Sessions.hs
@@ -0,0 +1,8 @@
+module SecondTransfer.Sessions(
+    makeSessionsContext
+    ,module SecondTransfer.Sessions.Config
+    ,SessionsContext
+    ) where 
+
+import SecondTransfer.Sessions.Config
+import SecondTransfer.Sessions.Internal
diff --git a/hs-src/SecondTransfer/Sessions/Config.hs b/hs-src/SecondTransfer/Sessions/Config.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Sessions/Config.hs
@@ -0,0 +1,93 @@
+{-# LANGUAGE FlexibleContexts, Rank2Types, TemplateHaskell, OverloadedStrings #-}
+module SecondTransfer.Sessions.Config(
+    sessionId
+    ,defaultSessionsConfig
+    ,sessionsCallbacks
+    ,reportErrorCallback
+
+
+    ,SessionComponent(..)
+    ,SessionCoordinates(..)
+    ,SessionsCallbacks(..)
+    ,SessionsConfig(..)
+    ,ErrorCallback
+    ) where 
+
+
+-- import           Control.Concurrent.MVar (MVar)
+import           Control.Exception       (SomeException)
+import           Control.Lens            (Lens', makeLenses)
+
+
+-- | Information used to identify a particular session. 
+newtype SessionCoordinates = SessionCoordinates  Int
+    deriving Show
+
+instance Eq SessionCoordinates where 
+    (SessionCoordinates a) == (SessionCoordinates b) =  a == b
+
+-- | Get/set a numeric Id from a `SessionCoordinates`. For example, to 
+--   get the session id with this, import `Control.Lens.(^.)` and then do 
+--
+-- @
+--      session_id = session_coordinates ^. sessionId
+-- @
+-- 
+sessionId :: Functor f => (Int -> f Int) -> SessionCoordinates -> f SessionCoordinates
+sessionId f (SessionCoordinates session_id) = 
+    fmap (\ s' -> (SessionCoordinates s')) (f session_id)
+
+
+
+-- | Components at an individual session. Used to report
+--   where in the session an error was produced. This interface is likely 
+--   to change in the future, as we add more metadata to exceptions
+data SessionComponent = 
+    SessionInputThread_HTTP2SessionComponent 
+    |SessionHeadersOutputThread_HTTP2SessionComponent
+    |SessionDataOutputThread_HTTP2SessionComponent
+    |Framer_HTTP2SessionComponent
+    |Session_HTTP11
+    deriving Show
+
+
+
+-- | Used by this session engine to report an error at some component, in a particular
+--   session. 
+type ErrorCallback = (SessionComponent, SessionCoordinates, SomeException) -> IO ()
+
+-- | Callbacks that you can provide your sessions to notify you 
+--   of interesting things happening in the server. 
+data SessionsCallbacks = SessionsCallbacks {
+    -- Callback used to report errors during this session
+    _reportErrorCallback :: Maybe ErrorCallback
+}
+
+makeLenses ''SessionsCallbacks
+
+
+-- | Configuration information you can provide to the session maker.
+data SessionsConfig = SessionsConfig {
+    -- | Session callbacks
+    _sessionsCallbacks :: SessionsCallbacks
+}
+
+-- makeLenses ''SessionsConfig
+
+-- | Lens to access sessionsCallbacks in the `SessionsConfig` object.
+sessionsCallbacks :: Lens' SessionsConfig SessionsCallbacks
+sessionsCallbacks  f (
+    SessionsConfig {
+        _sessionsCallbacks= s 
+    }) = fmap (\ s' -> SessionsConfig {_sessionsCallbacks = s'}) (f s)
+
+
+-- | Creates a default sessions context. Modify as needed using 
+--   the lenses interfaces
+defaultSessionsConfig :: SessionsConfig
+defaultSessionsConfig = SessionsConfig {
+    _sessionsCallbacks = SessionsCallbacks {
+            _reportErrorCallback = Nothing
+        }
+    }
+
diff --git a/hs-src/SecondTransfer/Sessions/Internal.hs b/hs-src/SecondTransfer/Sessions/Internal.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Sessions/Internal.hs
@@ -0,0 +1,67 @@
+{-# LANGUAGE FlexibleContexts, Rank2Types, TemplateHaskell, OverloadedStrings #-}
+module SecondTransfer.Sessions.Internal where 
+
+import SecondTransfer.Sessions.Config
+
+
+import           Control.Concurrent.MVar (MVar, newMVar,modifyMVar)
+-- import           Control.Exception       (SomeException)
+import qualified Control.Exception       as E
+import           Control.Lens            ((^.), makeLenses)
+
+
+import            System.Log.Logger
+
+
+
+-- | Contains information that applies to all 
+--   sessions created in the program. Use the lenses 
+--   interface to access members of this struct. 
+-- 
+data SessionsContext = SessionsContext {
+     _sessionsConfig  :: SessionsConfig
+    ,_nextSessionId   :: MVar Int
+    }
+
+
+makeLenses ''SessionsContext
+
+
+-- Session tags are simple session identifiers 
+acquireNewSessionTag :: SessionsContext -> IO Int 
+acquireNewSessionTag sessions_context = 
+    modifyMVar 
+        (sessions_context ^. nextSessionId )
+        (\ next_id -> return ((next_id+1), next_id))
+
+
+-- Adds runtime data to a context, and let it work.... 
+makeSessionsContext :: SessionsConfig -> IO SessionsContext
+makeSessionsContext sessions_config = do 
+    next_session_id_mvar <- newMVar 1 
+    return $ SessionsContext {
+        _sessionsConfig = sessions_config,
+        _nextSessionId = next_session_id_mvar
+        }
+
+
+
+sessionExceptionHandler :: 
+    E.Exception e => SessionComponent -> Int -> SessionsContext -> e -> IO ()
+sessionExceptionHandler session_component session_id sessions_context e = do 
+    let
+
+        getit = ( sessionsConfig . sessionsCallbacks . reportErrorCallback ) 
+        maybe_error_callback = sessions_context ^. getit 
+        component_tag = "Session." ++ (show session_component)
+        error_tuple = (
+            session_component,
+            SessionCoordinates session_id, 
+            E.toException e
+            )
+    case maybe_error_callback of 
+        Nothing -> 
+            errorM component_tag (show (e))
+
+        Just callback -> 
+            callback error_tuple
diff --git a/hs-src/SecondTransfer/Types.hs b/hs-src/SecondTransfer/Types.hs
new file mode 100644
--- /dev/null
+++ b/hs-src/SecondTransfer/Types.hs
@@ -0,0 +1,7 @@
+module SecondTransfer.Types(
+    module SecondTransfer.MainLoop.PushPullType
+    ,module SecondTransfer.MainLoop.CoherentWorker
+    ) where 
+
+import SecondTransfer.MainLoop.PushPullType 
+import SecondTransfer.MainLoop.CoherentWorker
diff --git a/hs-src/SecondTransfer/Utils.hs b/hs-src/SecondTransfer/Utils.hs
--- a/hs-src/SecondTransfer/Utils.hs
+++ b/hs-src/SecondTransfer/Utils.hs
@@ -10,7 +10,7 @@
     ,unfoldChannelAndSource
     ,stripString
     ,domainFromUrl
-
+    ,subByteString
     ) where 
 
 
@@ -104,3 +104,9 @@
   in 
     pack use_host
 
+
+-- Returns the sub-bytestring that starts at start_pos and ends
+-- just before end_pos
+subByteString :: Int -> Int -> B.ByteString -> B.ByteString
+subByteString start_pos end_pos  = 
+    B.take (end_pos - start_pos ) . B.drop start_pos 
diff --git a/hs-src/SecondTransfer/Utils/HTTPHeaders.hs b/hs-src/SecondTransfer/Utils/HTTPHeaders.hs
--- a/hs-src/SecondTransfer/Utils/HTTPHeaders.hs
+++ b/hs-src/SecondTransfer/Utils/HTTPHeaders.hs
@@ -1,16 +1,50 @@
+{-# LANGUAGE OverloadedStrings, Rank2Types #-}
+{-|
+
+Utilities for working with headers. 
+
+-}
 module SecondTransfer.Utils.HTTPHeaders (
+    -- * Simple manipulation
+    -- 
+    -- | These transformations are simple enough that don't require
+    --   going away from the list representation (see type `Headers`) 
     lowercaseHeaders
     ,headersAreValidHTTP2
+    ,fetchHeader
+    -- * Transformations based on maps
+    --
+    -- | Many operations benefit
+    --   from transforming the list to a map with custom sorting and 
+    --   doing a set of operations on that representation.
+    --
+    ,HeaderEditor
+    -- ** Introducing and removing the `HeaderEditor`
+    ,fromList 
+    ,toList 
+    -- ** Access to a particular header
+    ,headerLens
+    ,replaceHeaderValue
+    -- ** HTTP utilities
+    ,replaceHostByAuthority
     ) where 
 
-import           Data.Char          (isUpper)
-import           Data.Text          (toLower)
-import qualified Data.Text          as T
-import           Data.Text.Encoding (decodeUtf8, encodeUtf8)
+import qualified Control.Lens                           as L
+import           Control.Lens                           ( (^.) )
 
+import qualified Data.ByteString                        as B
+import           Data.Char                              (isUpper)
+import           Data.List                              (find)
+import           Data.Text                              (toLower)
+import qualified Data.Text                              as T
+import           Data.Text.Encoding                     (decodeUtf8, encodeUtf8)
+import qualified Data.Map.Strict                        as Ms
+import           Data.Word                              (Word8)
 
-import SecondTransfer.MainLoop.CoherentWorker      (Headers)
+import           Control.Applicative                    ((<$>))
 
+import           SecondTransfer.MainLoop.CoherentWorker (Headers)
+
 -- Why having a headers library? The one at Network.HTTP.Headers works
 -- with Strings and is not very friendly to custom headers. 
 -- This is a very basic, lightweight normalizer.
@@ -33,3 +67,85 @@
         (\ prev e -> (flip (&&)) (isOk  e) $! prev)
         True
         headers
+
+
+-- | Looks for a given header
+fetchHeader :: Headers -> B.ByteString -> Maybe B.ByteString
+fetchHeader headers header_name = 
+    snd 
+      <$> 
+    find ( \ x -> fst x == header_name ) headers 
+
+
+newtype Autosorted = Autosorted { toFlatBs :: B.ByteString }
+  deriving Eq
+
+
+colon :: Word8 
+colon = fromIntegral . fromEnum $ ':'
+
+
+instance Ord Autosorted where 
+  compare (Autosorted a) (Autosorted b) | (B.head a) == colon, (B.head b) /= colon = LT 
+  compare (Autosorted a) (Autosorted b) | (B.head a) /= colon, (B.head b) == colon = GT 
+  compare (Autosorted a) (Autosorted b)  = compare a b
+
+
+-- | Abstract data-type. Use `fromList` to get one of these from `Headers`. 
+-- The underlying representation admits better asymptotics.
+newtype HeaderEditor = HeaderEditor { innerMap :: Ms.Map Autosorted B.ByteString }
+
+
+-- | /O(n*log n)/ Builds the editor from a list. 
+fromList :: Headers -> HeaderEditor 
+fromList = HeaderEditor . Ms.fromList . map (\(hn, hv) -> (Autosorted hn, hv))
+
+-- | /O(n)/ Takes the HeaderEditor back to Headers
+toList :: HeaderEditor -> Headers 
+toList (HeaderEditor m) = [ (toFlatBs x, v) | (x,v) <- Ms.toList m ]
+
+
+-- | replaceHeaderValue headers header_name maybe_header_value looks for 
+--   header_name. If header_name is found and maybe_header_value is nothing, it 
+--   returns a new headers list with the header deleted. If header_name is found
+--   and header_value is Just new_value, it returns a new list with the header 
+--   containing the new value. If header_name is not in headers and maybe_header_value
+--   is Nothing, it returns the original headers list. If header_name is not in headers
+--   and maybe_header_value is Just new_value, it returns a new list where the last element
+--   is (header_name, new_value)
+replaceHeaderValue :: HeaderEditor -> B.ByteString -> Maybe B.ByteString -> HeaderEditor
+replaceHeaderValue (HeaderEditor m) header_name maybe_header_value = 
+    HeaderEditor $ Ms.alter (const maybe_header_value) (Autosorted header_name) m
+
+
+-- | headerLens header_name represents a lens into the headers,
+--   and you can use it then to add, alter and remove headers.
+--   It uses the same semantics than `replaceHeaderValue`
+headerLens :: B.ByteString -> L.Lens' HeaderEditor (Maybe B.ByteString)
+headerLens name = 
+    L.lens 
+        (Ms.lookup hname . innerMap ) 
+        (\(HeaderEditor hs) mhv -> HeaderEditor $ Ms.alter (const mhv) hname hs)
+  where 
+    hname = Autosorted name
+
+-- | Replaces a \"host\" HTTP\/1.1 header by an ":authority" HTTP\/2 
+-- header.
+-- The list is expected to be already in lowercase, so nothing will happen if there
+-- the header name portion is \"Host\" instead of \"host\".
+--
+-- Notice that having a "Host" header in an HTTP\/2 message is perfectly valid in certain 
+-- circumstances, check <https://http2.github.io/http2-spec/#rfc.section.8.1.2.3 Section 8.1.2.3>
+-- of the spec for details.
+replaceHostByAuthority :: HeaderEditor -> HeaderEditor
+replaceHostByAuthority  headers = 
+  let
+    host_lens :: L.Lens' HeaderEditor (Maybe B.ByteString)
+    host_lens = headerLens "host"
+    authority_lens = headerLens ":authority"
+    maybe_host_header = headers ^. host_lens
+    no_hosts = L.set host_lens Nothing headers
+  in 
+    case maybe_host_header of 
+        Nothing -> headers 
+        Just host -> L.set authority_lens (Just host) no_hosts
diff --git a/second-transfer.cabal b/second-transfer.cabal
--- a/second-transfer.cabal
+++ b/second-transfer.cabal
@@ -7,7 +7,7 @@
 -- PVP       summary:      +-+------- breaking API changes
 --                         | | +----- non-breaking API additions
 --                         | | | +--- code changes with no API change
-version     :              0.4.0.0
+version     :              0.5.0.0
 
 synopsis    :              Second Transfer HTTP/2 web server
 
@@ -44,7 +44,7 @@
 
 Flag debug 
   Description: Enable debug support 
-  Default:     False
+  Default:     True
 
 source-repository head
   type:     git
@@ -53,28 +53,42 @@
 source-repository this
   type:     git
   location: git@github.com:alcidesv/second-transfer.git
-  tag:      0.3.0.4
+  tag:      0.5.0.0
 
 library
 
   exposed-modules:  SecondTransfer
                   , SecondTransfer.MainLoop
-                  , SecondTransfer.MainLoop.OpenSSL_TLS
                   , SecondTransfer.Http2
-                  , SecondTransfer.MainLoop.Internal
+                  , SecondTransfer.Http1
                   , SecondTransfer.Exception
-                  , SecondTransfer.MainLoop.Logging
+                  , SecondTransfer.Types
                   , SecondTransfer.Utils.HTTPHeaders
+                  -- These are really internal modules, but  are exposed 
+                  -- here for the sake of the test suite. They are hidden 
+                  -- from the documentation.
+                  , SecondTransfer.MainLoop.Internal
+                  , SecondTransfer.MainLoop.OpenSSL_TLS
+                  , SecondTransfer.Sessions
+                  , SecondTransfer.Sessions.Config
+                  , SecondTransfer.Http1.Parse
 
   other-modules:  SecondTransfer.MainLoop.CoherentWorker
                 , SecondTransfer.MainLoop.PushPullType
                 , SecondTransfer.MainLoop.Tokens
                 , SecondTransfer.MainLoop.Framer
+                , SecondTransfer.MainLoop.Logging   
+                , SecondTransfer.Sessions.Internal             
+
                 , SecondTransfer.Utils
+
                 , SecondTransfer.Http2.Framer
                 , SecondTransfer.Http2.MakeAttendant
                 , SecondTransfer.Http2.Session
 
+                , SecondTransfer.Http1.Session
+
+
   build-tools: cpphs
 
   if flag(debug)
@@ -90,12 +104,12 @@
   -- Other library packages from which modules are imported.
   build-depends: base >=4.7 && < 4.8,
                  exceptions >= 0.8 && < 0.9,
-                 bytestring == 0.10.4.0,
+                 bytestring >= 0.10.4,
                  base16-bytestring >= 0.1.1,
                  network >= 2.6 && < 2.7,
                  text >= 1.2 && < 1.3,
-                 binary == 0.7.1.0,
-                 containers == 0.5.5.1,
+                 binary >= 0.7.1.0,
+                 containers >= 0.5.5,
                  conduit >= 1.2.4 && < 1.3,
                  transformers >=0.3 && <= 0.5,
                  network-uri >= 2.6 && < 2.7,
@@ -103,7 +117,8 @@
                  lens >= 4.7 && < 4.8,
                  http2 >= 0.7,
                  hslogger >= 1.2.6,
-                 hashable >= 1.2
+                 hashable >= 1.2,
+                 attoparsec >= 0.12
   
   -- Directories containing source files.
   hs-source-dirs: hs-src
@@ -119,11 +134,13 @@
   c-sources: cbits/tlsinc.c
 
   -- cc-options: -fPIC -pthread -g -O0
+  if flag(debug)
+      cc-options: -O0 -g3
 
   -- cc-options: -g3 -O0
 
   -- ghc-options: -O2
-
+ 
   extra-libraries: ssl crypto
 
   -- NOTICE: Please fill-in with an-up-to date library path here
@@ -155,7 +172,7 @@
                     ,conduit >= 1.2.4
                     ,lens  >= 4.7
                     ,HUnit >= 1.2 && < 1.3
-                    ,bytestring == 0.10.4.0
+                    ,bytestring >= 0.10.4.0
                     ,http2 == 0.9.1
   ghc-options     : -threaded
   other-modules   : SecondTransfer.Test.DecoySession
diff --git a/tests/tests-hs-src/SecondTransfer/Test/DecoySession.hs b/tests/tests-hs-src/SecondTransfer/Test/DecoySession.hs
--- a/tests/tests-hs-src/SecondTransfer/Test/DecoySession.hs
+++ b/tests/tests-hs-src/SecondTransfer/Test/DecoySession.hs
@@ -17,7 +17,7 @@
 import qualified Data.ByteString.Lazy    as LB
 
 import           SecondTransfer.Http2
-import           SecondTransfer.MainLoop
+import           SecondTransfer.Types
 import           SecondTransfer.MainLoop.Internal
 
 
diff --git a/tests/tests-hs-src/compiling_ok.hs b/tests/tests-hs-src/compiling_ok.hs
--- a/tests/tests-hs-src/compiling_ok.hs
+++ b/tests/tests-hs-src/compiling_ok.hs
@@ -5,9 +5,10 @@
 	, DataAndConclusion
 	, tlsServeWithALPNAndFinishOnRequest
 	, http2Attendant
+	, http11Attendant
 	, FinishRequest(..)
 	)
-import SecondTransfer.Http2(
+import SecondTransfer.Sessions(
 	  makeSessionsContext
 	, defaultSessionsConfig
 	)
@@ -38,19 +39,23 @@
 main = do 
 	sessions_context <- makeSessionsContext defaultSessionsConfig
 	finish <- newEmptyMVar
+	-- Make the server work only for small amount of time, so that 
+	-- continue running other tests
 	forkIO $ do 
 		threadDelay 1000000
 		putMVar finish FinishRequest 
 	let 
 		http2_attendant = http2Attendant sessions_context helloWorldWorker
+		http11_attendant = http11Attendant sessions_context helloWorldWorker
 	tlsServeWithALPNAndFinishOnRequest
 		"tests/support/servercert.pem"   -- Server certificate
 		"tests/support/privkey.pem"      -- Certificate private key
 		"127.0.0.1"                      -- On which interface to bind
 		[
 			("h2-14", http2_attendant),  -- Protocols present in the ALPN negotiation
-			("h2",    http2_attendant)   -- they may be slightly different, but for this 
+			("h2",    http2_attendant),   -- they may be slightly different, but for this 
 			                             -- test it doesn't matter.
+			("http/1.1", http11_attendant)
 		]
 		8000
 		finish
diff --git a/tests/tests-hs-src/hunit_tests.hs b/tests/tests-hs-src/hunit_tests.hs
--- a/tests/tests-hs-src/hunit_tests.hs
+++ b/tests/tests-hs-src/hunit_tests.hs
@@ -9,12 +9,17 @@
 
 import Tests.HTTP2Session
 import Tests.Utils
+import Tests.HTTP1Parse
 
 
 tests = TestList [
 	TestLabel "testPrefaceChecks" testPrefaceChecks,
 	TestLabel "testPrefaceChecks2" testPrefaceChecks2,
-    TestLabel "testLowercaseHeaders" testLowercaseHeaders
+    TestLabel "testLowercaseHeaders" testLowercaseHeaders,
+    TestLabel "testCRLFLocate" testCRLFLocate,
+    TestLabel "testHTTP1Parse" testParse,
+    TestLabel "testGenerate" testGenerate,
+    TestLabel "testReplaceHostByAuthority" testReplaceHostByAuthority
 	]
 
 
