]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler: Fix sending response headers to client
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 5 Apr 2024 08:46:22 +0000 (10:46 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 5 Apr 2024 08:46:22 +0000 (10:46 +0200)
commit38a3090a67cf44321f9e8b38163db6b4c21124fa
tree7476d8d243f9da7c87e3f7ba72de9f721b5cbbe7
parent5f9b8c0031cfab6eb616891f1441b352f121c7a2
scheduler: Fix sending response headers to client

Sometimes headers are not correctly copied into response to the client (some are missing). It happens because sent_header is set prematurely before the actual send happens. The present code in affected cupsdWriteClient() scope looks like code remains from CUPS 1.6.3, where cupsdSendHeader() is called earlier and generates the required headers by itself - the current cupsdSendHeader() sends only the headers which are saved in array fields, so the premature setting of sent_header sometimes causes not having all headers in the response.

With the change, testing via curl gives reliable results all time.
CHANGES.md
scheduler/client.c