From f1bf025c19ffbe651360cba72b2d117625b229ad Mon Sep 17 00:00:00 2001 From: saturn Date: Thu, 14 Oct 2021 01:24:29 -0500 Subject: [PATCH] Switch back to dexador in download-file. --- lw2-viewer.asd | 2 +- src/images.lisp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lw2-viewer.asd b/lw2-viewer.asd index f3166711..15c34304 100644 --- a/lw2-viewer.asd +++ b/lw2-viewer.asd @@ -1,7 +1,7 @@ (in-package :asdf) (asdf:defsystem :lw2-viewer - :depends-on ("uiop" "flexi-streams" "hunchentoot" "dexador" "drakma" "cl-json" "lmdb" "local-time" "plump" "clss" "cl-ppcre" "xml-emitter" "city-hash" "bit-smasher" "cl-unicode" "parse-js" "cl-markdown" "websocket-driver-client" "ironclad" "cl-base64" "djula" "split-sequence" "cl-typesetting" "named-readtables" "collectors" "closer-mop" "chronicity" "parenscript" "trivial-gray-streams" "trivia" "iterate" "introspect-environment" "trivial-macroexpand-all" "trivial-cltl2" "dufy/core") + :depends-on ("uiop" "flexi-streams" "hunchentoot" "dexador" "cl-json" "lmdb" "local-time" "plump" "clss" "cl-ppcre" "xml-emitter" "city-hash" "bit-smasher" "cl-unicode" "parse-js" "cl-markdown" "websocket-driver-client" "ironclad" "cl-base64" "djula" "split-sequence" "cl-typesetting" "named-readtables" "collectors" "closer-mop" "chronicity" "parenscript" "trivial-gray-streams" "trivia" "iterate" "introspect-environment" "trivial-macroexpand-all" "trivial-cltl2" "dufy/core") :components ((:module "src" :components ((:file "utils" :depends-on ("macro-utils")) (:file "macro-utils") diff --git a/src/images.lisp b/src/images.lisp index b45946f8..b022f5eb 100644 --- a/src/images.lisp +++ b/src/images.lisp @@ -80,12 +80,8 @@ (defun download-file (uri target) (sb-sys:with-deadline (:seconds 60) (with-open-file (out-stream target :direction :output :if-exists :supersede :element-type '(unsigned-byte 8)) - (multiple-value-bind (in-stream status) (drakma:http-request uri :want-stream t :force-binary t :connection-timeout 30 :accept "image/*,*/*") - (unwind-protect - (progn - (unless (= status 200) (error "HTTP error ~A" status)) - (alexandria:copy-stream in-stream out-stream)) - (close in-stream)))))) + (with-open-stream (in-stream (dex:get uri :want-stream t :force-binary t :keep-alive nil :connect-timeout 30 :headers '((:accept . "image/*,*/*")))) + (alexandria:copy-stream in-stream out-stream))))) (defun download-file-with-wayback-fallback (uri target) (handler-case -- 2.11.4.GIT