Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
artemredkin committed Aug 6, 2020
1 parent ae46004 commit 5924d12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Sources/AsyncHTTPClient/HTTPHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ extension HTTPClient {
}

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

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

public func write(_ buffer: ByteBuffer, promise: EventLoopPromise<Void>?) {
Expand Down
17 changes: 0 additions & 17 deletions Tests/AsyncHTTPClientTests/HTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -643,23 +643,6 @@ class HTTPClientTests: XCTestCase {
}

func testUploadStreaming() throws {
let body: HTTPClient.Body = .stream(length: 8) { writer in
let buffer = ByteBuffer(string: "1234")
return writer.write(.byteBuffer(buffer)).flatMap {
let buffer = ByteBuffer(string: "4321")
return writer.write(.byteBuffer(buffer))
}
}

let response = try self.defaultClient.post(url: self.defaultHTTPBinURLPrefix + "post", body: body).wait()
let bytes = response.body.flatMap { $0.getData(at: 0, length: $0.readableBytes) }
let data = try JSONDecoder().decode(RequestInfo.self, from: bytes!)

XCTAssertEqual(.ok, response.status)
XCTAssertEqual("12344321", data.data)
}

func testUploadStreaming2() throws {
let body: HTTPClient.Body = .stream2(length: 8) { writer in
var buffer = ByteBuffer(string: "1234")
writer.write(.byteBuffer(buffer), promise: nil)
Expand Down

0 comments on commit 5924d12

Please sign in to comment.