Skip to content

Commit

Permalink
Formatting change
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Sep 21, 2012
1 parent 45161d9 commit 0fe3de6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions blog/2012/9/caching-fd.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,14 @@ I explained the `sendfile` function and
the `sendfileWithHeader` function in
this article and the previous one, respectively:

```haskell
sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO ()
sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO ()
```
sendfile :: Socket -> FilePath -> FileRange -> IO () -> IO ()
sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO ()

To avoid the `open()`/`close()` system call, I added two more functions
to the simple-sendfile package:

```haskell
sendfileFd :: Socket -> Fd -> FileRange -> IO () -> IO ()
sendfileFdWithHeader :: Socket -> Fd -> FileRange -> IO () -> [ByteString] -> IO ()
```
sendfileFd :: Socket -> Fd -> FileRange -> IO () -> IO ()
sendfileFdWithHeader :: Socket -> Fd -> FileRange -> IO () -> [ByteString] -> IO ()

Of course, the master branch of Warp uses the last one.

Expand Down

0 comments on commit 0fe3de6

Please sign in to comment.