From ffcd60acc72299e3ded7f264faedc125c3c4b1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= Date: Sat, 16 Nov 2024 19:48:16 +0100 Subject: [PATCH] feat(easy): add support for IPRESOLVE option --- src/Easy.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Easy.zig b/src/Easy.zig index 4511d54..3f8ab18 100644 --- a/src/Easy.zig +++ b/src/Easy.zig @@ -384,6 +384,16 @@ pub fn setPassword(self: Self, password: [:0]const u8) !void { try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_PASSWORD, password.ptr)); } +pub const IpResolve = enum(c_int) { + whatever = c.CURL_IPRESOLVE_WHATEVER, + v4 = c.CURL_IPRESOLVE_V4, + v6 = c.CURL_IPRESOLVE_V6, +}; + +pub fn setIpResolve(self: Self, ipr: IpResolve) !void { + try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_IPRESOLVE, @intFromEnum(ipr))); +} + /// Perform sends an HTTP request and returns an HTTP response. pub fn perform(self: Self) !Response { try self.setCommonOpts();