authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-04 18:11:00 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-04 18:11:00 -08:00
log37028e958fd0a59763d302845afe7cada80155bd
tree211b3d85cefd6a5f117e02c5e3b4b95899e13cfd
parent2b8dd2520803c1e27c9ff33b1893d3f72f3427f0

byteSwap parseIPv4 result so it matches accept/connect addr order


1 files changed, 2 insertions(+), 2 deletions(-)

url.zig+2-2
...@@ -1334,7 +1334,7 @@ pub fn parseIPv4(input: []const u8) !u32 {...@@ -1334,7 +1334,7 @@ pub fn parseIPv4(input: []const u8) !u32 {
1334 // 2. Increment counter by 1.1334 // 2. Increment counter by 1.
1335 }1335 }
1336 // 13. Return ipv4.1336 // 13. Return ipv4.
1337 return ipv4;1337 return @byteSwap(ipv4);
1338}1338}
13391339
1340/// https://url.spec.whatwg.org/#ipv4-number-parser1340/// https://url.spec.whatwg.org/#ipv4-number-parser
...@@ -1597,7 +1597,7 @@ fn setHost(href: *ManyArrayList(15, u8), h: URL.Host) !void {...@@ -1597,7 +1597,7 @@ fn setHost(href: *ManyArrayList(15, u8), h: URL.Host) !void {
1597 },1597 },
1598 .ipv4 => {1598 .ipv4 => {
1599 const bytes: [4]u8 = @bitCast(h.ipv4);1599 const bytes: [4]u8 = @bitCast(h.ipv4);
1600 try href.print(7, "{d}.{d}.{d}.{d}", .{ bytes[3], bytes[2], bytes[1], bytes[0] });1600 try href.print(7, "{d}.{d}.{d}.{d}", .{ bytes[0], bytes[1], bytes[2], bytes[3] });
1601 },1601 },
1602 .ipv6 => {1602 .ipv6 => {
1603 const pieces: [8]u16 = @bitCast(h.ipv6);1603 const pieces: [8]u16 = @bitCast(h.ipv6);