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 30a7286
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Sources/AsyncHTTPClient/HTTPHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension HTTPClient {
///
/// - parameters:
/// - data: `IOData` to write.
@available(*, deprecated, message: "")
@available(*, deprecated, message: "StreamWriter is deprecated, please use StreamWriter2")
public func write(_ data: IOData) -> EventLoopFuture<Void> {
return self.closure(data)
}
Expand All @@ -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 All @@ -95,7 +95,7 @@ extension HTTPClient {
public var stream: (StreamWriter) -> EventLoopFuture<Void>
var stream2: ((StreamWriter2) -> Void)?

@available(*, deprecated, message: "")
@available(*, deprecated, message: "StreamWriter is deprecated, please use StreamWriter2")
init(length: Int?, stream: @escaping (StreamWriter) -> EventLoopFuture<Void>) {
self.length = length
self.stream = stream
Expand Down
1 change: 0 additions & 1 deletion Tests/AsyncHTTPClientTests/HTTPClientTests+XCTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ extension HTTPClientTests {
("testProxyPlaintextWithCorrectlyAuthorization", testProxyPlaintextWithCorrectlyAuthorization),
("testProxyPlaintextWithIncorrectlyAuthorization", testProxyPlaintextWithIncorrectlyAuthorization),
("testUploadStreaming", testUploadStreaming),
("testUploadStreaming2", testUploadStreaming2),
("testNoContentLengthForSSLUncleanShutdown", testNoContentLengthForSSLUncleanShutdown),
("testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown", testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown),
("testCorrectContentLengthForSSLUncleanShutdown", testCorrectContentLengthForSSLUncleanShutdown),
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 30a7286

Please sign in to comment.