diff options
-rw-r--r-- | mumi/messages.scm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/mumi/messages.scm b/mumi/messages.scm index 4e8920f..e10cf0f 100644 --- a/mumi/messages.scm +++ b/mumi/messages.scm @@ -158,8 +158,8 @@ we have to do this in a very convoluted way." (%config 'mail-dir) bug-id)) ;; This is a modified version of fetch-mbox from guile-debbugs: it -;; supports downloading with an offset. It also only supports -;; streaming and doesn't bother with msg-num. +;; supports downloading with an offset. It also doesn't bother with +;; msg-nums. (define* (fetch-mbox* instance bug-number #:optional mbox-type #:key offset mdate) "Download the mbox containing messages of bug BUG-NUMBER from the @@ -184,7 +184,7 @@ symbol 'email)." ,@(if mdate `((if-modified-since . ,mdate)) '())))) - (http-get uri #:streaming? #t #:headers headers))) + (http-get uri #:headers headers))) (define* (download-mbox bug-id) "Download the mbox of bug BUG-ID and store it in the mail directory @@ -209,15 +209,13 @@ the difference by providing the current file size as an offset." (and mtime (time-monotonic->date (make-time time-monotonic 0 mtime))))) - (lambda (response port) - (if port + (lambda (response body) + (if body (begin ;; TODO: append when using offset (with-output-to-file file-name (lambda () - (put-bytevector (current-output-port) - (get-bytevector-all port)))) - (close-port port) + (put-bytevector (current-output-port) body))) file-name) #f))))) |