anchor.diff:    (send-response response
                    :status status
                    :headers (append headers
  -                                  (list :transfer-encoding "chunked")))
  +                                  (list :transfer-encoding "chunked"))
  +                 :close nil)
     (let* ((request (response-request response))
            (async-stream (make-instance 'as:async-io-stream :socket (request-socket request)))
            (chunked-stream (chunga:make-chunked-stream async-stream)))
  -    (setf (chunga:chunked-stream-output-chunking-p chunked-stream) t)
  +    (setf (chunga:chunked-stream-output-chunking-p chunked-stream) t
  +          (response-chunk-stream response) chunked-stream)
       chunked-stream))
   
  -(defun finish-response (chunked-stream &key close)
  +(defun finish-response (response &key (close nil close-specified-p))
     "Given the stream passed back from start-response, finalize the response (send
      empty chunk) and close the connection, if specified."
     (wlog +log-debug+ "(response) Finish response (close ~a)~%" close)
  -  (force-output chunked-stream)
  -  (let* ((async-stream (chunga:chunked-stream-stream chunked-stream))
  -         (socket (as:stream-socket async-stream)))
  +  (let* ((chunked-stream (response-chunk-stream response))
  +         (request (response-request response))
  +         (socket (request-socket request)))
  +    ;; make sure the stream writes its final data
  +    (force-output chunked-stream)
  +    ;; auto-select the best close method, but only if close wasn't specified
  +    (unless close-specified-p
  +      (let ((request-headers (request-headers request)))
  +        (cond
  +          ;; we got Connection: keep-alive. so, keep-alive...
  +          ((string= (getf request-headers :connection) "keep-alive")
  +           (setf close nil))
  +          ;; we got a Connection: close so let's oblige the client
  +          ((string= (getf request-headers :connection) "close")
  +           (setf close t)))))
  +
       ;; write empty chunk
       (as:write-socket-data socket #(48 13 10 13 10)  ; "0\r\n\r\n"
         :write-cb (lambda (socket)
  
positive.code:                                                 (asdf:find-system :wookie))))))
    headers)
  
  (defun send-response (response &key (status 200) headers body close)
    "Send a response to an incoming request. Takes :status, :headers, and :body
     keyword arguments, which together form an entire response.
  
     If :close is T, close the client connection after the response has been
     sent fully."
    (wlog +log-debug+ "(response) Send response ~a (status ~a) (close ~a) (headers ~s) (body-length ~a)~%"
                      response status close
                      headers (length body))
  
negative.code:         (progn
            (wlog +log-debug+ "(response) Reset parser: ~a~%" response)
            (setup-parser socket)))
  
      ;; mark the response as having been sent
      (setf (response-finished-p response) t)))
  
  (defun start-response (response &key (status 200) headers)
  