diff options
Diffstat (limited to 'http-client.scm')
-rw-r--r-- | http-client.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/http-client.scm b/http-client.scm index 0dd9dff..58d045d 100644 --- a/http-client.scm +++ b/http-client.scm @@ -751,8 +751,16 @@ (open-input-file (cdr chunk)) ;; Should be a port otherwise (cdr chunk)))) + (when (port-closed? p) + (raise (http-client-error 'call-with-input-request* + (conc "At least one port for the multipart body has been already " + "consumed and closed. This may be due to a retry or a redirect. " + "Hint: use 'data:' or limit max-retry-attempts and " + "max-redirect-depth to zero and catch the resulting exception") + (list p) + 'port-already-consumed 'port p))) (handle-exceptions exn - (begin (close-input-port p) (raise exn)) + (begin (close-input-port p) (raise exn)) (sendfile p output-port)) (close-input-port p)) (display chunk output-port))) |