Skip to content

Commit 5924d12

Browse files
committed
fix warning
1 parent ae46004 commit 5924d12

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

Sources/AsyncHTTPClient/HTTPHandler.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ extension HTTPClient {
6464
}
6565

6666
public func write(_ buffer: ByteBuffer) -> EventLoopFuture<Void> {
67-
self.onChunk(.byteBuffer(buffer))
67+
return self.onChunk(.byteBuffer(buffer))
6868
}
6969

7070
public func write(_ data: IOData) -> EventLoopFuture<Void> {
71-
self.onChunk(data)
71+
return self.onChunk(data)
7272
}
7373

7474
public func write(_ buffer: ByteBuffer, promise: EventLoopPromise<Void>?) {

Tests/AsyncHTTPClientTests/HTTPClientTests.swift

-17
Original file line numberDiff line numberDiff line change
@@ -643,23 +643,6 @@ class HTTPClientTests: XCTestCase {
643643
}
644644

645645
func testUploadStreaming() throws {
646-
let body: HTTPClient.Body = .stream(length: 8) { writer in
647-
let buffer = ByteBuffer(string: "1234")
648-
return writer.write(.byteBuffer(buffer)).flatMap {
649-
let buffer = ByteBuffer(string: "4321")
650-
return writer.write(.byteBuffer(buffer))
651-
}
652-
}
653-
654-
let response = try self.defaultClient.post(url: self.defaultHTTPBinURLPrefix + "post", body: body).wait()
655-
let bytes = response.body.flatMap { $0.getData(at: 0, length: $0.readableBytes) }
656-
let data = try JSONDecoder().decode(RequestInfo.self, from: bytes!)
657-
658-
XCTAssertEqual(.ok, response.status)
659-
XCTAssertEqual("12344321", data.data)
660-
}
661-
662-
func testUploadStreaming2() throws {
663646
let body: HTTPClient.Body = .stream2(length: 8) { writer in
664647
var buffer = ByteBuffer(string: "1234")
665648
writer.write(.byteBuffer(buffer), promise: nil)

0 commit comments

Comments
 (0)