anchor.diff:           (route-path nil)
            (route nil)  ; holds the current route, filled in below once we get headers
            (route-dispatched nil)
  +         (error-occurred-p nil)
            (request (make-instance 'request :socket sock :http http))
            (response (make-instance 'response :request request))
            (body-buffer nil)
  
positive.code:                             (setf body-buffer (flex:make-in-memory-output-stream :element-type '(unsigned-byte 8))))
                            (write-sequence chunk body-buffer))))))
               (finish-callback ()
                 (setf body-finished-p t)
                 ;; make sure we always dispatch at the end.
                 (do-run-hooks (sock) (run-hooks :body-complete request)
  
negative.code:                ;; chunked, run the router now so it can set up chunk listening.
                 ;; otherwise, save the route for later and let the rest of the
                 ;; request come in.
                 (future-handler-case
                   (let* ((method (http-parse:http-method http))
                          (resource (http-parse:http-resource http))
                          (parsed-uri (puri:parse-uri resource))
                          (path (do-urlencode:urldecode (puri:uri-path parsed-uri) :lenientp t))
                          (host (getf headers :host)))
                     (wlog :info "(request)  ~a ~a ~s ~a ~a~%"
                           request
                           response
                           method
                           resource
                           (if host (concatenate 'string "(" host ")") ""))
                     (setf route-path path)
                     ;; save the parsed uri for plugins/later code
                     (setf (request-uri request) parsed-uri
                           (request-headers request) headers)
                     (do-run-hooks (sock) (run-hooks :parsed-headers request)
                       ;; set up some tracking/state values now that we have headers
                       ;; ALSO, check for _method var when routing.
                       (let* ((method (get-overridden-method request method))
                              (found-route (find-route method path :host host)))
                         (setf route found-route
                               (request-method request) method
                               (request-resource request) resource)
                         ;; handle "Expect: 100-continue" properly
                         (when (string= (getf headers :expect) "100-continue")
                           (if found-route
                               (unless (getf route :suppress-100)
                                 (send-100-continue response))
                               (progn
                                 (funcall 'main-event-handler (make-instance 'route-not-found :resource route-path :socket sock)
                                                              sock)
                                 (return-from header-callback))))
                         ;; if we found a route and the route allows chunking, call the
                         ;; route now so it can set up its chunk handler before we start
                         ;; streaming the body chunks to it
                         ;;
                         ;; NOTE that we don't *need* to test if the data is actually
                         ;; chunked for a chunk-enabled route to be able to receive the
                         ;; data. if a chunk-enabled route gets called for data that
                         ;; isn't chunked, it will receive all the data for that request
                         ;; as one big chunk.
                         (when (and found-route
                                    (getf found-route :allow-chunking))
                           (dispatch-route)))))
                   ;; pipe all uncaught errors we get to the main event handler
                   ;; (with our socket object).
                   ;;
                   ;; note that errors that are caught here are more or less fatal
                   ;; and as such, we stop processing the request any further by
                   ;; setting `error-occurred-p` to T which notifies the other
                   ;; callbacks (body/finished) that they shall not proceed any
                   ;; further with this request.
                   (error (e)
                     (setf error-occurred-p t)
                     (main-event-handler e sock))))
               (body-callback (chunk finishedp)
                 (when error-occurred-p
                   (return-from body-callback))
                 ;; forward the chunk to the callback provided in the chunk-enabled
                 ;; router
                 (do-run-hooks (sock) (run-hooks :body-chunk request chunk finishedp)
  