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 @@ -2350,7 +2350,7 @@ class HTTPClientTests: XCTestCase {
23502350 }
23512351
23522352 func testContentLengthTooLongFails( ) throws {
2353- let url = self . defaultHTTPBinURLPrefix + " / post"
2353+ let url = self . defaultHTTPBinURLPrefix + " post "
23542354 XCTAssertThrowsError (
23552355 try self . defaultClient. execute ( request:
23562356 Request ( url: url,
@@ -2379,7 +2379,7 @@ class HTTPClientTests: XCTestCase {
23792379
23802380 // currently gets stuck because of #250 the server just never replies
23812381 func testContentLengthTooShortFails( ) throws {
2382- let url = self . defaultHTTPBinURLPrefix + " / post"
2382+ let url = self . defaultHTTPBinURLPrefix + " post "
23832383 let tooLong = " XBAD BAD BAD NOT HTTP/1.1 \r \n \r \n "
23842384 XCTAssertThrowsError (
23852385 try self . defaultClient. execute ( request:
You can’t perform that action at this time.
0 commit comments