1
0
Fork 0

- simulated a server that send data slowly (but not slow enough to trigger a timeout).

This commit is contained in:
cage 2024-09-28 15:39:43 +02:00
parent 3f0cdae6d6
commit 9e3a93885f
1 changed files with 16 additions and 0 deletions

View File

@ -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))