Skip to content

Commit

Permalink
feat(easy): add support for IPRESOLVE option (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiffyk authored Nov 18, 2024
1 parent 667b702 commit 5e79c2b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Easy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5e79c2b

Please sign in to comment.