Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean clack-handler-toot up.
  • Loading branch information
fukamachi committed Mar 26, 2015
1 parent cbf284a commit 97f8a59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
9 changes: 5 additions & 4 deletions clack-handler-toot.asd
Expand Up @@ -22,10 +22,11 @@
:version "0.2.0"
:author "Eitaro Fukamachi"
:license "LLGPL"
:depends-on (:cl-syntax
:cl-syntax-annot
:toot
:depends-on (:toot
:flexi-streams
:bordeaux-threads
:cl-ppcre
:split-sequence
:cl-ppcre)
:alexandria)
:components ((:file "src/handler/toot"))
:description "Clack handler for Toot.")
26 changes: 7 additions & 19 deletions src/handler/toot.lisp
@@ -1,11 +1,3 @@
#|
This file is a part of Clack package.
URL: http://github.com/fukamachi/clack
Copyright (c) 2011 Eitaro Fukamachi <e.arrows@gmail.com>

Clack is freely distributable under the LLGPL License.
|#

(in-package :cl-user)
(defpackage clack.handler.toot
(:use :cl
Expand All @@ -17,16 +9,15 @@
:shutdown-p
:listen-socket
:listen-backlog
:acceptor-process
:accept-connections)
(:import-from :flexi-streams
:octets-to-string)
(:import-from :alexandria
:if-let))
:if-let)
(:export :run))
(in-package :clack.handler.toot)

(cl-syntax:use-syntax :annot)

@export
(defun run (app &key debug (port 5000)
ssl ssl-key-file ssl-cert-file ssl-key-password)
"Start Toot server."
Expand Down Expand Up @@ -59,13 +50,10 @@
:reuseaddress t
:backlog (listen-backlog acceptor)
:element-type '(unsigned-byte 8)))
(accept-connections acceptor)))


@export
(defun stop (acceptor)
"Stop Toot server."
(toot:stop-acceptor acceptor))
(setf (acceptor-process (toot:taskmaster acceptor)) (bt:current-thread))
(unwind-protect
(accept-connections acceptor)
(toot:stop-acceptor acceptor))))

(defun handle-request (req &key ssl)
"Convert Request from server into a plist
Expand Down

0 comments on commit 97f8a59

Please sign in to comment.