mirror of https://codeberg.org/cage/tinmop/
- [GUI] prevented stack overflow (ensured TCO) when downloading a non gemini text file.
This commit is contained in:
parent
0851c79c8d
commit
b3d7d47f10
|
@ -1177,7 +1177,9 @@ local file paths."
|
|||
(wait-enough-data)))
|
||||
|
||||
(defun slurp-non-text-data (main-window iri &key (try-to-open t))
|
||||
(declare (optimize (debug 0) (speed 3)))
|
||||
(labels ((wait-until-download-complete (stream-info support-file)
|
||||
(declare (optimize (debug 0) (speed 3)))
|
||||
(if (string-equal (getf stream-info :stream-status)
|
||||
:completed)
|
||||
(if try-to-open
|
||||
|
@ -1186,12 +1188,14 @@ local file paths."
|
|||
(getf stream-info :meta)))
|
||||
(wait-enough-data)))
|
||||
(buffer-filled-enough-to-open-p (buffer-size read-so-far)
|
||||
(declare (optimize (debug 0) (speed 3)))
|
||||
(let ((filled-configuration-threshold (and buffer-size
|
||||
(> read-so-far buffer-size))))
|
||||
(or filled-configuration-threshold
|
||||
(> read-so-far
|
||||
swconf:+buffer-minimum-size-to-open+))))
|
||||
(wait-enough-data ()
|
||||
(declare (optimize (debug 0) (speed 3)))
|
||||
(let* ((stream-info
|
||||
(cev:enqueue-request-and-wait-results :gemini-stream-info
|
||||
1
|
||||
|
|
|
@ -1282,7 +1282,7 @@
|
|||
|
||||
(defun link-regex->program-to-use-buffer-size (link)
|
||||
(when-let ((found (link-regex->program-to-use-parameters link)))
|
||||
(buffer-size found)))
|
||||
(buffer-size found)))
|
||||
|
||||
(defun use-tinmop-as-external-program-p (program)
|
||||
(cl-ppcre:scan "(^me$)|(^internal$)|(tinmop)" program))
|
||||
|
|
Loading…
Reference in New Issue