File tree 2 files changed +6
-4
lines changed
Tests/AsyncHTTPClientTests
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -867,15 +867,17 @@ extension TaskHandler: ChannelDuplexHandler {
867
867
return context. eventLoop. makeSucceededFuture ( ( ) )
868
868
}
869
869
870
+ let channel = context. channel
871
+
870
872
func doIt( ) -> EventLoopFuture < Void > {
871
873
return body. stream ( HTTPClient . Body. StreamWriter { part in
872
874
let promise = self . task. eventLoop. makePromise ( of: Void . self)
873
875
// 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 {
875
877
self . actualBodyLength += part. readableBytes
876
878
context. writeAndFlush ( self . wrapOutboundOut ( . body( part) ) , promise: promise)
877
879
} else {
878
- context . eventLoop. execute {
880
+ channel . eventLoop. execute {
879
881
self . actualBodyLength += part. readableBytes
880
882
context. writeAndFlush ( self . wrapOutboundOut ( . body( part) ) , promise: promise)
881
883
}
Original file line number Diff line number Diff line change @@ -2319,7 +2319,7 @@ class HTTPClientTests: XCTestCase {
2319
2319
}
2320
2320
2321
2321
func testContentLengthTooLongFails( ) throws {
2322
- let url = self . defaultHTTPBinURLPrefix + " / post"
2322
+ let url = self . defaultHTTPBinURLPrefix + " post "
2323
2323
XCTAssertThrowsError (
2324
2324
try self . defaultClient. execute ( request:
2325
2325
Request ( url: url,
@@ -2348,7 +2348,7 @@ class HTTPClientTests: XCTestCase {
2348
2348
2349
2349
// currently gets stuck because of #250 the server just never replies
2350
2350
func testContentLengthTooShortFails( ) throws {
2351
- let url = self . defaultHTTPBinURLPrefix + " / post"
2351
+ let url = self . defaultHTTPBinURLPrefix + " post "
2352
2352
let tooLong = " XBAD BAD BAD NOT HTTP/1.1 \r \n \r \n "
2353
2353
XCTAssertThrowsError (
2354
2354
try self . defaultClient. execute ( request:
You can’t perform that action at this time.
0 commit comments