Comments (2)
I confirmed this function gets called and finishes, but the .whenComplete
callback is never called
https://github.com/apple/swift-nio-examples/blob/909a55e/connect-proxy/Sources/ConnectProxy/ConnectHandler.swift#L229
private func httpErrorAndClose(context: ChannelHandlerContext) {
self.upgradeState = .upgradeFailed
let headers = HTTPHeaders([("Content-Length", "0"), ("Connection", "close")])
let head = HTTPResponseHead(version: .init(major: 1, minor: 1), status: .badRequest, headers: headers)
context.write(self.wrapOutboundOut(.head(head)), promise: nil)
context.write(self.wrapOutboundOut(.end(nil))).whenComplete { (_: Result<Void, Error>) in
context.close(mode: .output, promise: nil)
}
}
from swift-nio-examples.
Yeah, I think there’s a flush missing on that path. We should just turn that last write
into writeAndFlush
.
from swift-nio-examples.
Related Issues (20)
- http2-client should use ALPNHandler
- http2-client should suppress uncleanShutdown errors
- Document why SMTPResponseDecoder uses ChannelInboundHandler
- NIOSMTP should support STARTTLS HOT 2
- the JSONRPC example codecs should move into swift-nio-extras
- should publish API docs HOT 2
- NIOSMTP: should implement escaping
- TCPClient in json-rpc isn't thread-safe HOT 2
- json-rpc: license headers missing
- connect-proxy is missing a README HOT 1
- Using JSONRPC codecs in another project HOT 2
- build swift-nio-example failed get error, memory file not found HOT 1
- connect-proxy example isn't working with DNS Over HTTPS HOT 11
- Example of JSON RPC using blocking semantics? HOT 6
- proper HTTP server example
- http2-client fatally fails with IP address URLs HOT 1
- http2-client fatally fails when connection is refused HOT 2
- connect-proxy demo access http resource return 'Invalid HTTP message type get' HOT 1
- HTTPS Connection hangs when using Connect-Proxy with Android Emulator HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-nio-examples.