diff --git a/src/gemini/dummy-server.lisp b/src/gemini/dummy-server.lisp index f78c34a..183fe99 100644 --- a/src/gemini/dummy-server.lisp +++ b/src/gemini/dummy-server.lisp @@ -59,6 +59,22 @@ and key stored in the file pointed by the filesystem path request client-cert-fingerprint) (cond + ((cl-ppcre:scan "slow" request) + (format t "slow...~%") + (let ((response (format nil + "~a text/gemini~a~a" + (code gemini-client::+20+) + #\return #\newline))) + (format t "sending: ~a~%" response) + (write-sequence (text-utils:string->octets response) + stream) + (loop for i from 0 below 10000 do + (sleep 1) + (write-sequence (text-utils:string->octets (format nil "~a~%" i)) + stream) + (finish-output stream)) + (close stream) + (get-data))) ((cl-ppcre:scan "timeout" request) (format t "timeout...~%") (sleep 3600))