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 @@ -2350,7 +2350,7 @@ class HTTPClientTests: XCTestCase {
2350
2350
}
2351
2351
2352
2352
func testContentLengthTooLongFails( ) throws {
2353
- let url = self . defaultHTTPBinURLPrefix + " / post"
2353
+ let url = self . defaultHTTPBinURLPrefix + " post "
2354
2354
XCTAssertThrowsError (
2355
2355
try self . defaultClient. execute ( request:
2356
2356
Request ( url: url,
@@ -2379,7 +2379,7 @@ class HTTPClientTests: XCTestCase {
2379
2379
2380
2380
// currently gets stuck because of #250 the server just never replies
2381
2381
func testContentLengthTooShortFails( ) throws {
2382
- let url = self . defaultHTTPBinURLPrefix + " / post"
2382
+ let url = self . defaultHTTPBinURLPrefix + " post "
2383
2383
let tooLong = " XBAD BAD BAD NOT HTTP/1.1 \r \n \r \n "
2384
2384
XCTAssertThrowsError (
2385
2385
try self . defaultClient. execute ( request:
You can’t perform that action at this time.
0 commit comments