summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-07 15:01:16 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-07 15:01:16 +0200
commit242b162f8428cc2cd7c23dd67703bbdc73747b1a (patch)
tree0692880356ffd455480ba2676bd35ea8ead3a16a
parent2160a4f77d4ad56cbb7d186c609d42bd5ebf54c4 (diff)
messages: fetch-mbox*: Don't use streaming.
This would be nice but it leads to a fd leak somehow.
-rw-r--r--mumi/messages.scm14
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)))))