Closed Bug 1772205 Opened 2 years ago Closed 2 years ago

Create Http2StreamConnection - a special version of HTTP/2 stream for CONNECT requests

Categories

(Core :: Networking: HTTP, task, P3)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: dragana, Assigned: dragana)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged])

Attachments

(3 files)

Proposal:

Http2StreamConnection is a special version of Http2Stream that also acts as a nsISocketTransport to the inner nsHttpConnection.

In addition to implementing Http2StreamBase(see bug 1767609), Http2StreamConnection needs to implement:

  • nsISocketTransport

Two separate hepler classes, Http2StreamConnectionOutputStream and Http2StreamConnectionInputStream, need to implement:

  • nsIAsyncInputStream
  • nsIAsyncOutputStream

Functionalities:

  • When nsHttpConnection(or TLSTransportLayer) calls AsyncWait on the Http2StreamConnectionOutputStream, TransactionHasDataToWrite of the underlying Http2Session is called.
  • When nsHttpConnection call AsyncWait on the Http2StreamConnectionInputStream, TransactionHasDataToRead of the underlying Http2Session is called.
  • Http2Session will call ReadSegments/WriteSegments of the Http2StreamConnection when the Http2StreamConnection can read/write data. The Http2StreamConnection should call nsHttpConnection/TLSTransportLayer::OnOutputStreamReady or nsHttpConnection/TLSTransportLayer::OnInputStreamReady respectively.
Blocks: 1772212
Assignee: nobody → dd.mozilla
Status: NEW → ASSIGNED
Summary: Create Http2StreamConnention - a special version of HTTP/2 stream for CONNECT requests → Create Http2StreamConnection - a special version of HTTP/2 stream for CONNECT requests

The stream will behave as HTTP/2 stream for the HTTP/2 session to the proxy as well as a SocketTransport for the nsHttpConnection through the tunnel. nsHttpConnection will be responsible for sending the CONNECT request the same way as it does in case of a HTTP/1.1. proxy.

Attached file Improve closing of Http2StreamTunnel. (deleted) —

Currently we have a single Close function that is called by a transaction through nsISocketTransport interface and from the underlying HTTP/2 session. The behavior in 2 cases are different, but it is hard to distinguish them. We will split them into CloseStream and Close functions.
The patch also adds some more testing of the close behavior.

Attached file Add more test for failures: (deleted) —

Add test for HTTP/2 stream and session error to the proxy and to the origin server. Also test if the errors affect other streams.

Also the weak reference to the tunnel needs to be removed when the stream is closed due to problems with freeing weak reference on a wrong stream.

Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ea5625892397 Implement a special version of Http2Stream that will be used for tunneling. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/200553c584de Improve closing of Http2StreamTunnel. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/d9d615352628 Add more test for failures: r=necko-reviewers,kershaw

Backed out for causing bp-hybrid bustages on Http2StreamTunnel.

Push with failures

Failure log from OS X Cross Compiled plain bp-hybrid bustage
Failure log from Windows 2012 x64 debug bp-hybrid bustage

Backout link

[task 2022-08-04T12:32:59.569Z] 12:32:59     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/netwerk/protocol/http'
[task 2022-08-04T12:32:59.572Z] 12:32:59     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/MacOSX11.0.sdk -mmacosx-version-min=10.12 -stdlib=libc++ -std=gnu++17 --target=x86_64-apple-darwin -o Http2StreamTunnel.o -c  -fvisibility=hidden -fvisibility-inlines-hidden -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_MACOSX=1 -DHAS_CONNECTX -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/netwerk/protocol/http -I/builds/worker/workspace/obj-build/netwerk/protocol/http -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/netwerk/base -I/builds/worker/checkouts/gecko/netwerk/cookie -I/builds/worker/checkouts/gecko/netwerk/dns -I/builds/worker/checkouts/gecko/netwerk/ipc -I/builds/worker/checkouts/gecko/netwerk/socket/neqo_glue -I/builds/worker/checkouts/gecko/netwerk/url-classifier -I/builds/worker/checkouts/gecko/extensions/auth -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wno-ambiguous-reversed-operator -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-enum-float-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wno-error=deprecated-volatile -Wcomma -Wimplicit-fallthrough -Wduplicate-method-arg -Wduplicate-method-match -Wmissing-method-return-type -Wobjc-signed-char-bool -Wsemicolon-before-method-body -Wsuper-class-method-mismatch -Werror=non-literal-null-conversion -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=free-nonheap-object -Wno-error=return-std-move -Wno-error=atomic-alignment -Wno-error=deprecated-copy -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-psabi -Wthread-safety -Wno-unknown-warning-option -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Http2StreamTunnel.o.pp   /builds/worker/checkouts/gecko/netwerk/protocol/http/Http2StreamTunnel.cpp
[task 2022-08-04T12:32:59.574Z] 12:32:59    ERROR -  /builds/worker/checkouts/gecko/netwerk/protocol/http/Http2StreamTunnel.cpp:352:35: error: use of undeclared identifier 'do_QueryObject'
[task 2022-08-04T12:32:59.575Z] 12:32:59     INFO -    RefPtr<nsHttpConnection> conn = do_QueryObject(aCallback);
[task 2022-08-04T12:32:59.575Z] 12:32:59     INFO -                                    ^
[task 2022-08-04T12:32:59.576Z] 12:32:59     INFO -  1 error generated.
[task 2022-08-04T12:32:59.576Z] 12:32:59    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:668: Http2StreamTunnel.o] Error 1
[task 2022-08-04T12:32:59.577Z] 12:32:59     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/netwerk/protocol/http'
[task 2022-08-04T12:32:59.577Z] 12:32:59     INFO -  gmake[4]: *** Waiting for unfinished jobs....
[task 2022-08-04T12:32:59.578Z] 12:32:59     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/third_party/libwebrtc/common_audio/common_audio_gn'
Flags: needinfo?(kershaw)
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4335ced4d484 Implement a special version of Http2Stream that will be used for tunneling. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/58c3061e18da Improve closing of Http2StreamTunnel. r=necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/e59ce1d680da Add more test for failures: r=necko-reviewers,kershaw
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Regressions: 1783493
Regressions: 1783567
Blocks: 1772202
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: