mirror of
https://github.com/swift-server/async-http-client.git
synced 2026-06-02 07:37:34 +00:00
Motivation: When we stream request body, current implementation expects that body will finish streaming _before_ we start to receive response body parts. This is not correct, reponse body parts can start to arrive before we finish sending the request. Modifications: - Simplifies state machine, we only case about request being fully sent to prevent sending body parts after .end, but response state machine is mostly ignored and correct flow will be handled by NIOHTTP1 pipeline - Adds HTTPEchoHandler, that replies to each response body part - Adds bi-directional streaming test Result: Closes #327
57 lines
3.1 KiB
Swift
57 lines
3.1 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the AsyncHTTPClient open source project
|
|
//
|
|
// Copyright (c) 2018-2019 Apple Inc. and the AsyncHTTPClient project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of AsyncHTTPClient project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// HTTPClientInternalTests+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension HTTPClientInternalTests {
|
|
static var allTests: [(String, (HTTPClientInternalTests) -> () throws -> Void)] {
|
|
return [
|
|
("testHTTPPartsHandler", testHTTPPartsHandler),
|
|
("testBadHTTPRequest", testBadHTTPRequest),
|
|
("testHostPort", testHostPort),
|
|
("testHTTPPartsHandlerMultiBody", testHTTPPartsHandlerMultiBody),
|
|
("testHTTPResponseHeadBeforeRequestHead", testHTTPResponseHeadBeforeRequestHead),
|
|
("testHTTPResponseDoubleHead", testHTTPResponseDoubleHead),
|
|
("testRequestFinishesAfterRedirectIfServerRespondsBeforeClientFinishes", testRequestFinishesAfterRedirectIfServerRespondsBeforeClientFinishes),
|
|
("testProxyStreaming", testProxyStreaming),
|
|
("testProxyStreamingFailure", testProxyStreamingFailure),
|
|
("testUploadStreamingBackpressure", testUploadStreamingBackpressure),
|
|
("testRequestURITrailingSlash", testRequestURITrailingSlash),
|
|
("testChannelAndDelegateOnDifferentEventLoops", testChannelAndDelegateOnDifferentEventLoops),
|
|
("testResponseConnectionCloseGet", testResponseConnectionCloseGet),
|
|
("testWeNoticeRemoteClosuresEvenWhenConnectionIsIdleInPool", testWeNoticeRemoteClosuresEvenWhenConnectionIsIdleInPool),
|
|
("testWeTolerateConnectionsGoingAwayWhilstPoolIsShuttingDown", testWeTolerateConnectionsGoingAwayWhilstPoolIsShuttingDown),
|
|
("testRaceBetweenAsynchronousCloseAndChannelUsabilityDetection", testRaceBetweenAsynchronousCloseAndChannelUsabilityDetection),
|
|
("testResponseFutureIsOnCorrectEL", testResponseFutureIsOnCorrectEL),
|
|
("testUncleanCloseThrows", testUncleanCloseThrows),
|
|
("testUploadStreamingIsCalledOnTaskEL", testUploadStreamingIsCalledOnTaskEL),
|
|
("testWeCanActuallyExactlySetTheEventLoops", testWeCanActuallyExactlySetTheEventLoops),
|
|
("testTaskPromiseBoundToEL", testTaskPromiseBoundToEL),
|
|
("testConnectErrorCalloutOnCorrectEL", testConnectErrorCalloutOnCorrectEL),
|
|
("testInternalRequestURI", testInternalRequestURI),
|
|
("testBodyPartStreamStateChangedBeforeNotification", testBodyPartStreamStateChangedBeforeNotification),
|
|
("testHandlerDoubleError", testHandlerDoubleError),
|
|
("testTaskHandlerStateChangeAfterError", testTaskHandlerStateChangeAfterError),
|
|
]
|
|
}
|
|
}
|