Skip to content

Commit

Permalink
Bigger fetch limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed May 26, 2024
1 parent 0958ac9 commit bf0e7a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/builtins/builtins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ pub fn zErrFunc(comptime f: fn (vm: *cy.VM, args: [*]const Value, nargs: u8) any

pub fn prepThrowZError(ctx: cy.Context, err: anyerror, optTrace: ?*std.builtin.StackTrace) Value {
if (!cy.isFreestanding and C.verbose()) {
log.tracev("{}", .{err});
if (optTrace) |trace| {
std.debug.dumpStackTrace(trace.*);
}
Expand Down
2 changes: 2 additions & 0 deletions src/http.zig
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ pub const StdHttpClient = struct {
fn fetch(ptr: *anyopaque, alloc: std.mem.Allocator, method: std.http.Method, uri: std.Uri, headers: Headers) anyerror!Response {
const self = cy.ptrAlignCast(*StdHttpClient, ptr);
var buf = std.ArrayList(u8).init(alloc);
defer buf.deinit();
const res = try self.client.fetch(.{
.response_storage = .{ .dynamic = &buf },
.method = method,
.max_append_size = 1e9,
.location = .{ .uri = uri },
.headers = headers,
});
Expand Down
8 changes: 6 additions & 2 deletions src/sema.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2121,8 +2121,12 @@ pub fn resolveUserVar(c: *cy.Chunk, sym: *cy.sym.UserVar) !void {
if (sym.isResolved()) {
return;
}
const typeId = try resolveTypeSpecNode(c, sym.decl.?.typeSpec);
c.resolveUserVar(sym, typeId);
if (sym.decl.?.typed) {
const typeId = try resolveTypeSpecNode(c, sym.decl.?.typeSpec);
c.resolveUserVar(sym, typeId);
} else {
c.resolveUserVar(sym, bt.Dyn);
}
}

pub fn resolveHostVar(c: *cy.Chunk, sym: *cy.sym.HostVar) !void {
Expand Down

0 comments on commit bf0e7a1

Please sign in to comment.