You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-12-30 00:09:53 +02:00
Allow users to specify HTTP in the endpoint but default to using HTTPS in all other scenarios to preserve the existing behavior. Extend HttpUrl with a `defaultType` parameter to support either: - Explicitly specifying a protocol via `.type` and enforcing that protocol is used in the URL. - Allowing protocol to be parsed from URL, but providing default via `.defaultType` if no protocol is found in the URL. Add partial write handling in fdWrite() to support non-blocking socket operations. The write loop now handles EAGAIN errors by waiting for the file descriptor to become writable, and continues writing the remaining bytes when write() returns fewer bytes than requested. This is required for HTTP, which may use non-blocking sockets, but doesn't have built in handling like the TLS client we are using for HTTPS. Also wrap the write() call and add a shim and additional logging for easier unit testing.