generator/continuation added by arew on Sat Aug 8 14:58:41 2020
(define (http-request-chunked-body-generator generator)
(define chunks #f)
(define (next-chunk)
(call-with-values chunks
(lambda (symbol extensions-or-headers . maybe-chunk)
(case symbol
((chunk)
(set! continue (generator/continuation (car maybe-chunk)
next-chunk))
(continue))
((headers) (set! continue eof-object?) (eof-object))))))
(define (start)
(set! chunks (http-request-chunks-generator generator))
(next-chunk))
(define continue start)
(lambda ()
(continue)))