about summary refs log tree commit diff
path: root/users/sterni/mblog/mblog.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/mblog/mblog.lisp')
-rw-r--r--users/sterni/mblog/mblog.lisp18
1 files changed, 4 insertions, 14 deletions
diff --git a/users/sterni/mblog/mblog.lisp b/users/sterni/mblog/mblog.lisp
index 36a31376c8..7823bde203 100644
--- a/users/sterni/mblog/mblog.lisp
+++ b/users/sterni/mblog/mblog.lisp
@@ -1,5 +1,5 @@
 ;; SPDX-License-Identifier: GPL-3.0-only
-;; SPDX-FileCopyrightText: Copyright (C) 2022 by sterni
+;; SPDX-FileCopyrightText: Copyright (C) 2022-2023 by sterni
 ;; SPDX-FileCopyrightText: Copyright (C) 2006-2010 by Walter C. Pelissero
 
 (in-package :mblog)
@@ -26,16 +26,6 @@
                            :if-does-not-exist :create)
      ,@body))
 
-(defvar *copy-buffer-size* 4096)
-
-(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 *copy-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* "
@@ -70,8 +60,7 @@ a:link, a:visited {
       (:title (who:esc ,title))
       (:link :rel "stylesheet"
              :type "text/css"
-             :href ,(concatenate 'string (if root "" "../") "style.css"))
-      (:style "a:link, a:visited { color: blue; }"))
+             :href ,(concatenate 'string (if root "" "../") "style.css")))
      (:body
       (:header
        (:nav
@@ -101,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))