aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent-messaging
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-04-25 16:23:52 +0100
committerChristopher Baines <mail@cbaines.net>2023-04-25 16:23:52 +0100
commit07e42953f257b846d44376d998cc7d654214ca17 (patch)
tree6e79ba1dfb56694a5908002610e079e359ea8e47 /guix-build-coordinator/agent-messaging
parent040d782804dfa298a8d3e03c632e490e024aa255 (diff)
downloadbuild-coordinator-07e42953f257b846d44376d998cc7d654214ca17.tar
build-coordinator-07e42953f257b846d44376d998cc7d654214ca17.tar.gz
Remove read-request-body workaround
The Guile chunked input port now raises an exception when the input is incomplete.
Diffstat (limited to 'guix-build-coordinator/agent-messaging')
-rw-r--r--guix-build-coordinator/agent-messaging/http/server.scm24
1 files changed, 0 insertions, 24 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm
index 0f3faac..736c1db 100644
--- a/guix-build-coordinator/agent-messaging/http/server.scm
+++ b/guix-build-coordinator/agent-messaging/http/server.scm
@@ -49,30 +49,6 @@
#:use-module (guix-build-coordinator coordinator)
#:export (http-agent-messaging-start-server))
-(define (bad-request message . args)
- (throw 'bad-request message args))
-
-(define (fixed/read-request-body r)
- "Reads the request body from R, as a bytevector. Return ‘#f’
-if there was no request body."
- (cond
- ((member '(chunked) (request-transfer-encoding r))
- (make-chunked-input-port* (request-port r)
- ;; closing the port is handled elsewhere
- #:keep-alive? #t))
- (else
- (let ((nbytes (request-content-length r)))
- (and nbytes
- (let ((bv (get-bytevector-n (request-port r) nbytes)))
- (if (= (bytevector-length bv) nbytes)
- bv
- (bad-request "EOF while reading request body: ~a bytes of ~a"
- (bytevector-length bv) nbytes))))))))
-
-(module-set! (resolve-module '(web request))
- 'read-request-body
- fixed/read-request-body)
-
(define (http-agent-messaging-start-server port host secret-key-base
build-coordinator
chunked-request-channel)