Closed Bug 1607731 Opened 5 years ago Closed 3 years ago

Refactor http CONNECT tunnels

Categories

(Core :: Networking: HTTP, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: dragana, Assigned: dragana)

Details

(Whiteboard: [necko-triaged][http-conn])

The current code is somewhat great and it shows how you can make very interesting stuff. It is at the same time hard to reason about and has caused some bugs that are usually hard to debug and tend to introduce new bugs.

Let's decouple that code a bit and let's try to reuse already existing code paths which should introduce less bugs.

a tunnel should behave as a socket to a request.
the real connection should only write to a tunnel's buffer (and not also call reading the data which introduce a long chains that are hard to keep in the way that we avoid UAF). The tunnel (actually behaving as a socket) can be polled. The poll function will return "readable" if there is something in the buffer. Writing to the socket (actually the tunnel) can directly write to the underlying real socket or a stream. Real socket error will close the tunnel/socket and the same code paths will be be use as if the tunnel was actually the real socket. The error on a request or a tunneled h2 session that would cause a real socket to be closed would closed the the tunnel(it may be only closing a h2 stream or a socket).

Summary: Refactor http/2 tunnels → Refactor http CONNECT tunnels
Whiteboard: [http-conn]
Priority: -- → P2
Whiteboard: [http-conn] → [necko-triaged][http-conn]

This also involves fixing websockets over H2.

Assignee: nobody → valentin.gosu
Assignee: valentin.gosu → dd.mozilla
Severity: normal → S3

This has been fixed with the proxy stabilization project.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.