Comments (3)
On further inspection, I'm actually surprised this works at all... Shouldn't the name defined here (https://github.com/seanmonstar/hyper/blob/master/src/header.rs#L93) be dropped at the end of the function, leaving you with a dangling pointer to it?
from hyper.
Hrm, you're right, that should be a dangling pointer... does it manage to work because HashMap stores the hash u64, instead of the actual &str
, and so when checking later, it looks up by u64?
from hyper.
It has to store the actual string to resolve collisions, but it will only access the string if there is a collision. Given that most of the examples insert a limited number of headers, it's likely that there just aren't any collisions to resolve in them.Thanks,
Jonathan Reem
On Sat, Sep 6, 2014 at 11:15 PM, Sean McArthur [email protected]
wrote:
Hrm, you're right, that should be a dangling pointer... does it manage to work because HashMap stores the hash u64, instead of the actual
&str
, and so when checking later, it looks up by u64?Reply to this email directly or view it on GitHub:
#12 (comment)
from hyper.
Related Issues (20)
- Hyper 0.14.27 deprecated/backports features don't produce any warnings, but can't upgrade to hyper 1.0 HOT 3
- UnexpectedEof Error on HTTP/2 Requests with Rustls HOT 16
- Error serving connection: hyper::Error(Http2, Error { kind: GoAway(b"", PROTOCOL_ERROR, Library) }) HOT 4
- Make send_file example streaming HOT 3
- hyper-util: add (tokio) Server struct and builder (inspired by Hyper 0.14) HOT 2
- [SSRF] Ability to prohibit connections to subnet ranges HOT 1
- Get some time informations about a request like curl/libcurl
- Harden against HTTP Desync attacks HOT 2
- ffi: different input and output types for tasks HOT 2
- Make examples usable (TokioIo) HOT 8
- CHANGELOG doesn't explain what happened to `hyper::Client` or `HttpConnector` HOT 8
- Documentation link in hyper::client::conn for "Higher-level Client API" should probably go to hyper-util now HOT 1
- First byte timeout HOT 1
- From v0.14 to v1 difficulties using Client HOT 1
- hyper-util Client examples are wrong HOT 1
- Upgraded does not impl AsyncRead/AsyncWrite in hyper 1.0 HOT 2
- Can not create hyper::Error HOT 3
- hyper-util missing `max_pending_accept_reset_streams` HOT 1
- There is no way to pass data to the new Server connection service in Hyper 1
- "make_service_fn" - gone. Where is it?
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 hyper.