about summary refs log tree commit diff
path: root/users/sterni
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni')
-rw-r--r--users/sterni/mblog/mblog.lisp11
-rw-r--r--users/sterni/mblog/packages.lisp1
2 files changed, 3 insertions, 9 deletions
diff --git a/users/sterni/mblog/mblog.lisp b/users/sterni/mblog/mblog.lisp
index 61ba5511d6ff..7823bde20343 100644
--- a/users/sterni/mblog/mblog.lisp
+++ b/users/sterni/mblog/mblog.lisp
@@ -26,14 +26,6 @@
                            :if-does-not-exist :create)
      ,@body))
 
-(defun redirect-stream (in out)
-  "Consume input stream IN and write all its content to output stream OUT.
-  The streams' element types need to match."
-  (let ((buf (make-array config:*general-buffer-size* :element-type (stream-element-type in))))
-    (loop for pos = (read-sequence buf in)
-          while (> pos 0)
-          do (write-sequence buf out :end pos))))
-
 ;; CSS
 
 (defvar *style* "
@@ -98,7 +90,8 @@ a:link, a:visited {
         (with-overwrite-file (attachment-out attachment-dst
                               :element-type
                               (stream-element-type attachment-in))
-          (redirect-stream attachment-in attachment-out)))))
+          (redirect-stream attachment-in attachment-out
+                           :buffer-size *general-buffer-size*)))))
 
   (values))
 
diff --git a/users/sterni/mblog/packages.lisp b/users/sterni/mblog/packages.lisp
index 03c33f7efe12..d6e33955d31c 100644
--- a/users/sterni/mblog/packages.lisp
+++ b/users/sterni/mblog/packages.lisp
@@ -50,6 +50,7 @@
    :config)
   (:export :build-mblog)
   (:import-from :local-time :universal-to-timestamp)
+  (:import-from :mime4cl :redirect-stream)
   (:shadowing-import-from :common-lisp :list))
 
 (defpackage :cli