semantic bufo search find-bufo.com
bufo
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rename freshClient to httpClient

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

zzstoatzz fb4da68a e475f1a0

+6 -7
+6 -7
bot/src/bsky.zig
··· 25 25 if (self.did) |did| self.allocator.free(did); 26 26 } 27 27 28 - // create fresh http client for each request to avoid stale connections 29 - fn freshClient(self: *BskyClient) http.Client { 28 + fn httpClient(self: *BskyClient) http.Client { 30 29 return .{ .allocator = self.allocator }; 31 30 } 32 31 33 32 pub fn login(self: *BskyClient) !void { 34 33 std.debug.print("logging in as {s}...\n", .{self.handle}); 35 34 36 - var client = self.freshClient(); 35 + var client = self.httpClient(); 37 36 defer client.deinit(); 38 37 39 38 var body_buf: std.ArrayList(u8) = .{}; ··· 80 79 pub fn uploadBlob(self: *BskyClient, data: []const u8, content_type: []const u8) ![]const u8 { 81 80 if (self.access_jwt == null) return error.NotLoggedIn; 82 81 83 - var client = self.freshClient(); 82 + var client = self.httpClient(); 84 83 defer client.deinit(); 85 84 86 85 var auth_buf: [512]u8 = undefined; ··· 122 121 pub fn createQuotePost(self: *BskyClient, quote_uri: []const u8, quote_cid: []const u8, blob_json: []const u8, alt_text: []const u8) !void { 123 122 if (self.access_jwt == null or self.did == null) return error.NotLoggedIn; 124 123 125 - var client = self.freshClient(); 124 + var client = self.httpClient(); 126 125 defer client.deinit(); 127 126 128 127 var body_buf: std.ArrayList(u8) = .{}; ··· 165 164 pub fn getPostCid(self: *BskyClient, uri: []const u8) ![]const u8 { 166 165 if (self.access_jwt == null) return error.NotLoggedIn; 167 166 168 - var client = self.freshClient(); 167 + var client = self.httpClient(); 169 168 defer client.deinit(); 170 169 171 170 var parts = mem.splitScalar(u8, uri[5..], '/'); ··· 207 206 } 208 207 209 208 pub fn fetchImage(self: *BskyClient, url: []const u8) ![]const u8 { 210 - var client = self.freshClient(); 209 + var client = self.httpClient(); 211 210 defer client.deinit(); 212 211 213 212 var aw: Io.Writer.Allocating = .init(self.allocator);