"operation was canceled: received unexpected message from connection" - but why?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.3k
- Forks
- 1.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
Version
commit bd6c35b98f9513f14ed9cecad933bc7fdb8635ea
Platform
Linux 5.14.0-3-amd64 #1 SMP Debian 5.14.12-1 (2021-10-14) x86_64 GNU/Linux
Description
I run curl using hyper as a HTTP backend and I suddenly ran into a problem. I have a test case (206) which makes a CONNECT request to a test server and it gets a 175 bytes response back. The response looks like this:
HTTP/1.1 407 Authorization Required to proxy me my dear
Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
Content-Length: 33
And you should ignore this data.
That is: I don't spot any issues, and this works sometimes and it works with libcurl's native HTTP code.
However, hyper often decides to fail on this response. hyper_executor_poll() then returns a task that is HYPER_TASK_ERROR and if I extract the value from that task and then call hyper_error_print() it returns:
operation was canceled: received unexpected message from connection
First: what exactly is the unexpectedness it received? I don't see it in my logs. I don't get it.
Second: "message" ? Did it really receive a message over the connection?
I presume that this issue happens to me because of something I've done wrong in using the API, but I struggle to understand what, a lot because the error message doesn't help me understand the problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test case 206 and trace the CONNECT response through hyper_executor_poll() until hyper_error_print() produces the cancellation error. Compare the behavior with libcurl's native HTTP code and inspect where the unexpected connection condition is classified. Done means identifying the received condition and making the reported error understandable, with coverage for this response path if an existing test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100