From 5e79c2b2e683621d0bfc537d388eaca59be34d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= Date: Mon, 18 Nov 2024 01:43:12 +0100 Subject: [PATCH] feat(easy): add support for IPRESOLVE option (#22) --- src/Easy.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Easy.zig b/src/Easy.zig index 4511d54..7ed000d 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();