guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 723f2167bf9ca868ce775a8ad5d21039a82bb184
Author: Christopher Baines <[email protected]>
AuthorDate: Sat Feb 28 15:53:19 2026 +0000

    store: Add #:buffer-size option to open-connection.
    
    To make it easier to change the buffer-size.  Change the related procedures
    accordingly.
    
    * guix/store.scm (%default-buffer-size): New variable.
    (connect-to-daemon): Use %default-buffer-size.
    (open-connection): Add #:buffer-size argument and pass to connect-to-daemon.
    
    Change-Id: If62e3a40ea19c17d0de374652bc5714b6114a339
---
 guix/store.scm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index bd90da22cd..30344da91f 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -356,11 +356,13 @@ non-blocking."
                                     (errno (system-error-errno args)))))
                  (loop rest)))))))))
 
+(define %default-buffer-size 8192)
+
 (define* (connect-to-daemon uri-or-filename #:key non-blocking?
-                            (buffer-size 8192))
+                            (buffer-size %default-buffer-size))
   "Connect to the daemon at URI-OR-FILENAME and return an input/output port.
 If NON-BLOCKING?, use a non-blocking socket when using the file, unix or guix
-URI schemes.  A default BUFFER-SIZE of 8192 is used.
+URI schemes.  Use BUFFER-SIZE defaulting to 8192.
 
 This is a low-level procedure that does not perform the initial handshake with
 the daemon.  Use 'open-connection' for that."
@@ -403,7 +405,8 @@ the daemon.  Use 'open-connection' for that."
 
 (define* (open-connection #:optional (uri (%daemon-socket-uri))
                           #:key port (reserve-space? #t) cpu-affinity
-                          non-blocking? built-in-builders)
+                          non-blocking? built-in-builders
+                          (buffer-size %default-buffer-size))
   "Connect to the daemon at URI (a string), or, if PORT is not #f, use it as
 the I/O port over which to communicate to a build daemon.
 
@@ -415,7 +418,7 @@ for this connection will be pinned.  If NON-BLOCKING?, use 
a non-blocking
 socket when using the file, unix or guix URI schemes.  If
 BUILT-IN-BUILDERS is provided, it should be a list of strings
 and this will be used instead of the builtin builders provided by the build
-daemon.  Return a server object."
+daemon.  A default BUFFER-SIZE of 8192 is used.  Return a server object."
   (define (handshake-error)
     (raise (condition
             (&store-connection-error (file (or port uri))
@@ -428,7 +431,8 @@ daemon.  Return a server object."
              (handshake-error)))
     (let ((port
            (or port (connect-to-daemon
-                     uri #:non-blocking? non-blocking?))))
+                     uri #:non-blocking? non-blocking?
+                     #:buffer-size buffer-size))))
       (write-value integer %worker-magic-1 port)
       (force-output port)
       (let ((r (read-value integer port)))

Reply via email to