Skip to content

Commit 9e2ccca

Browse files
committed
std.http: address review comments
thank you everybody
1 parent e6124bc commit 9e2ccca

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

lib/std/Uri.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ pub fn parse(text: []const u8) ParseError!Uri {
377377

378378
pub const ResolveInPlaceError = ParseError || error{NoSpaceLeft};
379379

380-
/// Resolves a URI against a base URI, conforming to RFC 3986, Section 5.
380+
/// Resolves a URI against a base URI, conforming to
381+
/// [RFC 3986, Section 5](https://www.rfc-editor.org/rfc/rfc3986#section-5)
381382
///
382383
/// Assumes new location is already copied to the beginning of `aux_buf.*`.
383384
/// Parses that new location as a URI, and then resolves the path in place.

lib/std/http.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ pub const Reader = struct {
496496
return reader.in;
497497
},
498498
.deflate => {
499-
decompressor.* = .{ .flate = .init(reader.in, .raw, decompression_buffer) };
499+
decompressor.* = .{ .flate = .init(reader.in, .zlib, decompression_buffer) };
500500
return &decompressor.flate.reader;
501501
},
502502
.gzip => {
@@ -730,7 +730,7 @@ pub const Decompressor = union(enum) {
730730
return transfer_reader;
731731
},
732732
.deflate => {
733-
decompressor.* = .{ .flate = .init(transfer_reader, .raw, buffer) };
733+
decompressor.* = .{ .flate = .init(transfer_reader, .zlib, buffer) };
734734
return &decompressor.flate.reader;
735735
},
736736
.gzip => {

lib/std/http/Client.zig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ pub const ConnectionPool = struct {
115115
/// Tries to release a connection back to the connection pool.
116116
/// If the connection is marked as closing, it will be closed instead.
117117
///
118-
/// `allocator` must be the same one used to create `connection`.
119-
///
120118
/// Threadsafe.
121119
pub fn release(pool: *ConnectionPool, connection: *Connection) void {
122120
pool.mutex.lock();
@@ -484,10 +482,8 @@ pub const Response = struct {
484482
};
485483
var it = mem.splitSequence(u8, bytes, "\r\n");
486484

487-
const first_line = it.next().?;
488-
if (first_line.len < 12) {
489-
return error.HttpHeadersInvalid;
490-
}
485+
const first_line = it.first();
486+
if (first_line.len < 12) return error.HttpHeadersInvalid;
491487

492488
const version: http.Version = switch (int64(first_line[0..8])) {
493489
int64("HTTP/1.0") => .@"HTTP/1.0",

0 commit comments

Comments
 (0)