This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c_sendfile :: Fd -> Fd -> COff -> CSize -> IO CSsize | |
#if defined(LINUX) | |
c_sendfile ofd ifd o c = do | |
alloca $ \off -> do | |
poke off o | |
r <- c_sendfile_linux ofd ifd off c | |
return r | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
req1 = B.concat | |
[ "GET /favicon.ico HTTP/1.1\r\n" | |
, "Host: 0.0.0.0=5000\r\n" | |
, "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0\r\n" | |
, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" | |
, "Accept-Language: en-us,en;q=0.5\r\n" | |
, "Accept-Encoding: gzip,deflate\r\n" | |
, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" | |
, "Keep-Alive: 300\r\n" | |
, "Connection: keep-alive\r\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
threadDelay :: Int -> IO () Source | |
Suspends the current thread for a given number of microseconds (GHC only). | |
There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will ***never continue to run earlier than specified***. | |
--- | |
module Main where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aycan@fgt:~/haskell/snap-server/test$ ./runTestsAndCoverage.sh | |
Snap.Internal.Http.Parser.Tests: | |
show: [OK] | |
parseCookie: [OK] | |
chunked transfer encoding: [OK, passed 1000 tests] | |
chunk . unchunk == id: [OK, passed 1000 tests] | |
pipelined chunk . unchunk == id: [Failed] | |
Falsifiable with seed -6342116022785088208, after 12 tests. Reason: Exception: 'control message: Just (Err "not enough bytes")' | |
testBothChunkedEmpty: [Failed] | |
ERROR: control message: Just (Err "not enough bytes") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aycan@fgt:~/haskell/snap-server/test$ ./runTestsAndCoverage.sh | |
Snap.Internal.Http.Parser.Tests: | |
show: [OK] | |
parseCookie: [OK] | |
chunked transfer encoding: [OK, passed 1000 tests] | |
chunk . unchunk == id: [OK, passed 1000 tests] | |
testBothChunkedBuffered1: [Failed] | |
Falsifiable with seed 8872790038128987215, after 2 tests. Reason: Exception: 'control message: Just (Err "not enough bytes")' | |
testBothChunkedBuffered2: [Failed] | |
Falsifiable with seed 932625037523277916, after 6 tests. Reason: Exception: 'control message: Just (Err "not enough bytes")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pRequest' :: Parser IRequest | |
pRequest' = IRequest | |
<$> (option "" crlf *> pMethod) <* sp | |
<*> pUri <* sp | |
<*> pVersion <* crlf | |
<*> pHeaders <* crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Session | |
( sessionCookie | |
, withSession | |
, newSessionCookie | |
, session | |
) where | |
import Control.Monad.Trans (liftIO) | |
import Control.Applicative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell, TypeFamilies, DeriveDataTypeable, | |
FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, | |
UndecidableInstances, TypeOperators | |
#-} | |
module App.ObjectStore | |
( objectStoreHandlers | |
) where | |
import Coretal.Services.OpenIDHandlers | |
-- import Happstack.Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evTimerSetRepeat :: EvTimerPtr -> Double -> IO () | |
evTimerSetRepeat p t = do | |
evtimer <- peek p | |
poke p evtimer { repeat = t } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | throw a timeout exception to the handling thread -- it'll clean up | |
-- everything | |
timerCallback :: EvLoopPtr -- ^ loop obj | |
-> EvTimerPtr -- ^ timer obj | |
-> IORef CTime -- ^ when to timeout? | |
-> MVar ThreadId -- ^ thread to kill | |
-> TimerCallback | |
timerCallback loop tmr ioref tmv _ _ _ = do | |
debug "Backend.timerCallback: entered" |
OlderNewer