publish: Harmonize buffer size values and configuration.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 10 Nov 2020 21:59:13 +0000 (16:59 -0500)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Mon, 16 Nov 2020 05:04:32 +0000 (00:04 -0500)
commit630602831dd93e7bc9a8e64fba958300e8cb0474
treee12c2332119aeda7adacff5750b16d8214bdd127
parent62343288ef6dc56027d268ef773ae699a4bbb76d
publish: Harmonize buffer size values and configuration.

This change harmonizes the way we configure the buffer sizes and the socket
options, so that we don't forget to change it at one place like it happened in
commit 5e3d169945935b53325e6b738a307ba286751259.

* guix/scripts/publish.scm (%default-buffer-size)
(%default-socket-options): New variables.
* guix/scripts/publish.scm (configure-socket): New procedure.
(compress-nar): Use %default-buffer-size for the buffer size, increased from
128 to 208 KiB.
(nar-response-port): Likewise, increased from 64 to 208 KiB.
(http-write): Use configure-socket to set socket options.
(open-server-socket): Likewise.
guix/scripts/publish.scm