mirror of https://codeberg.org/cage/tinmop/
- forced using the cache in 'stream-iri' if a stream for the same URL already exists.
This commit is contained in:
parent
46ba8f2d07
commit
14aa2af9aa
|
@ -75,6 +75,13 @@
|
||||||
(defun find-streaming-stream-url ()
|
(defun find-streaming-stream-url ()
|
||||||
(find-db-stream-if (lambda (a) (eq (status a) +stream-status-streaming+))))
|
(find-db-stream-if (lambda (a) (eq (status a) +stream-status-streaming+))))
|
||||||
|
|
||||||
|
(defun url-streaming-p (url)
|
||||||
|
(find-db-stream-if (lambda (a)
|
||||||
|
(and (string= (server-stream-handle a)
|
||||||
|
url)
|
||||||
|
(eq (status a)
|
||||||
|
+stream-status-streaming+)))))
|
||||||
|
|
||||||
(defgeneric stop-stream-thread (object))
|
(defgeneric stop-stream-thread (object))
|
||||||
|
|
||||||
(defmethod stop-stream-thread ((object gemini-stream))
|
(defmethod stop-stream-thread ((object gemini-stream))
|
||||||
|
@ -1147,11 +1154,18 @@ local file paths."
|
||||||
(status +stream-status-streaming+)
|
(status +stream-status-streaming+)
|
||||||
(process-iri-lines-function (collect-iri-lines-clsr main-window
|
(process-iri-lines-function (collect-iri-lines-clsr main-window
|
||||||
iri)))
|
iri)))
|
||||||
|
(flet ((actually-use-cache-p ()
|
||||||
|
;; we need to use 't' or 'nil' as results from this
|
||||||
|
;; function because the json-rpc does not know how to
|
||||||
|
;; encode generalized booleans to JSON
|
||||||
|
(if (url-streaming-p iri)
|
||||||
|
t
|
||||||
|
use-cache)))
|
||||||
(let ((connecting-response (cev:enqueue-request-and-wait-results :gemini-request
|
(let ((connecting-response (cev:enqueue-request-and-wait-results :gemini-request
|
||||||
1
|
1
|
||||||
ev:+maximum-event-priority+
|
ev:+maximum-event-priority+
|
||||||
iri
|
iri
|
||||||
use-cache
|
(actually-use-cache-p)
|
||||||
nil)))
|
nil)))
|
||||||
(multiple-value-bind (status-code
|
(multiple-value-bind (status-code
|
||||||
status-description
|
status-description
|
||||||
|
@ -1241,7 +1255,7 @@ local file paths."
|
||||||
:status status)))
|
:status status)))
|
||||||
(push-db-stream background-stream))))
|
(push-db-stream background-stream))))
|
||||||
(t
|
(t
|
||||||
(error "Unrecognized stream status for address ~s: ~s" iri status))))))))
|
(error "Unrecognized stream status for address ~s: ~s" iri status)))))))))
|
||||||
|
|
||||||
(defun open-iri-clsr (main-window use-cache)
|
(defun open-iri-clsr (main-window use-cache)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
Loading…
Reference in New Issue