File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Tests/AsyncHTTPClientTests Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -867,15 +867,17 @@ extension TaskHandler: ChannelDuplexHandler {
867867 return context. eventLoop. makeSucceededFuture ( ( ) )
868868 }
869869
870+ let channel = context. channel
871+
870872 func doIt( ) -> EventLoopFuture < Void > {
871873 return body. stream ( HTTPClient . Body. StreamWriter { part in
872874 let promise = self . task. eventLoop. makePromise ( of: Void . self)
873875 // All writes have to be switched to the channel EL if channel and task ELs differ
874- if context . eventLoop. inEventLoop {
876+ if channel . eventLoop. inEventLoop {
875877 self . actualBodyLength += part. readableBytes
876878 context. writeAndFlush ( self . wrapOutboundOut ( . body( part) ) , promise: promise)
877879 } else {
878- context . eventLoop. execute {
880+ channel . eventLoop. execute {
879881 self . actualBodyLength += part. readableBytes
880882 context. writeAndFlush ( self . wrapOutboundOut ( . body( part) ) , promise: promise)
881883 }
Original file line number Diff line number Diff line change @@ -2319,7 +2319,7 @@ class HTTPClientTests: XCTestCase {
23192319 }
23202320
23212321 func testContentLengthTooLongFails( ) throws {
2322- let url = self . defaultHTTPBinURLPrefix + " / post"
2322+ let url = self . defaultHTTPBinURLPrefix + " post "
23232323 XCTAssertThrowsError (
23242324 try self . defaultClient. execute ( request:
23252325 Request ( url: url,
@@ -2348,7 +2348,7 @@ class HTTPClientTests: XCTestCase {
23482348
23492349 // currently gets stuck because of #250 the server just never replies
23502350 func testContentLengthTooShortFails( ) throws {
2351- let url = self . defaultHTTPBinURLPrefix + " / post"
2351+ let url = self . defaultHTTPBinURLPrefix + " post "
23522352 let tooLong = " XBAD BAD BAD NOT HTTP/1.1 \r \n \r \n "
23532353 XCTAssertThrowsError (
23542354 try self . defaultClient. execute ( request:
You can’t perform that action at this time.
0 commit comments