Callers can pass an exit code to nsIAppStartup::Quit and it will be returned from the process when
it exits.
Note that I have using uint16_t as the exit code because on Windows the exit code can be a uint and
elsewhere it is an int. A uint16_t will safely convert to either of those and no-one will ever need
more than 64k exit codes!
Differential Revision: https://phabricator.services.mozilla.com/D96857
This change only moves the DNS encoding & parsing methods to another file.
It is intended to be functionally the same - the most relevant change is
getting rid of mExtendedCode in TRR.h and using the return code to signal
NS_ERROR_DEFINITIVE_UNKNOWN_HOST.
Differential Revision: https://phabricator.services.mozilla.com/D96211
This function is a helper for clearing all storageAccessAPI permissions
that were modified after a certain date. We need to get them and filter
by principal to clear them.
Differential Revision: https://phabricator.services.mozilla.com/D96639
Some PSM services need to be initialized on the main thread. Before this patch,
this was achieved by dispatching a synchronous task to the main thread in the
event that a different thread was attempting to acquire a given service for the
first time. However, with the upcoming removal of the nested event loop in the
XPCOM service instantiation code (see other patches in this bug), this can
cause a deadlock. This patch avoids the deadlock by removing the synchronous
dispatch and ensuring that these services get initialized on the main thread
relatively early, when PSM itself is initialized.
Differential Revision: https://phabricator.services.mozilla.com/D94145
Before this patch, if nsIDNSService were created on a thread other than the
main thread, the code that instantiates it would synchronously dispatch an
event to the main thread to do the actual construction. However, this can lead
to deadlocks unless the XPCOM service instantiation code uses a nested event
loop to work around such problems. Since that causes stability issues, this
patch reworks the nsIDNSService constructor to only run on the main thread, and
ensures that the code calling the constructor only runs on the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D92799
Due to various reasons (network change, temporary network congestion, etc) it
may happen that we exceed the limit of TRR failures thus going into
CONFIRM_FAILED state and setting the timer for automatic retry.
When confirmation is not "skip" we want to reduce the amount of time as much
as possible - so if it's a transient reason for the failures, we should retry
as early as possible.
This patch reduces the initial timer to 125 ms (down from 1000 ms).
Exponential backoff is still in effect, so the only effect should be retrying
earlier. We also turn it into a pref, so it's easy to experiment with it to
find the perfect value.
Depends on D96822
Differential Revision: https://phabricator.services.mozilla.com/D96823
This needs to count encrypted data, therefore it is implemented as a NSPR layer right above the PR_NSPR_IO_LAYER layer.
Differential Revision: https://phabricator.services.mozilla.com/D96083
This function is a helper for clearing all storageAccessAPI permissions
that were modified after a certain date. We need to get them and filter
by principal to clear them.
Differential Revision: https://phabricator.services.mozilla.com/D96639
The test expects the only code that would call SetAllowSTS=false is the OCSP code. Making the captive portal do that too messes up expectations. A follow-up to bug 1556194 is necessary.
Depends on D97152
Differential Revision: https://phabricator.services.mozilla.com/D97172
supportsHttp3 is only needed for telemetry therefore it is only set on HTTP2 connections. It is also moved to nsIHttpChannelInternal.
Differential Revision: https://phabricator.services.mozilla.com/D96585
This telemetry will be collected for transaction that have used HTTP3 and transaction that have used HTTP2 but the servers they are connecting to support HTTP3.
Differential Revision: https://phabricator.services.mozilla.com/D96459
it will test transactions that are in 3 different states:
- transaction has received some data before the protocol error occurred. This transaction will be closed with NS_ERROR_NET_PARTIAL_TRANSFER
- transaction has only send some data but has not received any data. This transaction will be closed with NS_ERROR_NET_HTTP3_PROTOCOL_ERROR
- transaction is queued in Http3Session because of the stream concurrency limit. In this case the transaction will be restarted and it will succeeed using HTTP2.
Differential Revision: https://phabricator.services.mozilla.com/D95988
This error is well mitigated with checking if a certificate is valied for a domain before dispatching. If we include this error we will have a case as in test_altsvc_https.js where a domain is valid for foo.example.com but not for bar.example.com and if bar.example.com as altsvc to that domain the domain will be excluded for foo.example.com.
Differential Revision: https://phabricator.services.mozilla.com/D95845
- Add 2 test: 1) server is not listening to the port and 2) server is not responding that will cause the connection to timeout and fall back to HTTP2
- Adds a server that only reads packets but never sends any to simulate a handshake timing out
Differential Revision: https://phabricator.services.mozilla.com/D95816
Domains are excluded:
- if NS_ERROR_NET_HTTP3_PROTOCOL_ERROR error happens, this is a single error for all different HTTP3 protocol errors,
- also if a connection times out before the handshake is done
Change the current behavior to exclude HTTP3 domains instead of excluding the origin host names. HTTP2 disable AltSvc mapping if a origin domain is excluded which may not be ideal. This patch only changes behavior of HTTP3.
Refactor test_http3_fatal_stream_error.js. The test use to try to connect to http3 server on port 443 that does nto exist and it would return an error. This patch make the test use HTTP2 so that the the connection to the origin host (not AltSvc host) succeeds.
Differential Revision: https://phabricator.services.mozilla.com/D95807
This error is well mitigated with checking if a certificate is valied for a domain before dispatching. If we include this error we will have a case as in test_altsvc_https.js where a domain is valid for foo.example.com but not for bar.example.com and if bar.example.com as altsvc to that domain the domain will be excluded for foo.example.com.
Differential Revision: https://phabricator.services.mozilla.com/D95845
- Add 2 test: 1) server is not listening to the port and 2) server is not responding that will cause the connection to timeout and fall back to HTTP2
- Adds a server that only reads packets but never sends any to simulate a handshake timing out
Differential Revision: https://phabricator.services.mozilla.com/D95816
Domains are excluded:
- if NS_ERROR_NET_HTTP3_PROTOCOL_ERROR error happens, this is a single error for all different HTTP3 protocol errors,
- also if a connection times out before the handshake is done
Change the current behavior to exclude HTTP3 domains instead of excluding the origin host names. HTTP2 disable AltSvc mapping if a origin domain is excluded which may not be ideal. This patch only changes behavior of HTTP3.
Refactor test_http3_fatal_stream_error.js. The test use to try to connect to http3 server on port 443 that does nto exist and it would return an error. This patch make the test use HTTP2 so that the the connection to the origin host (not AltSvc host) succeeds.
Differential Revision: https://phabricator.services.mozilla.com/D95807
This error is well mitigated with checking if a certificate is valied for a domain before dispatching. If we include this error we will have a case as in test_altsvc_https.js where a domain is valid for foo.example.com but not for bar.example.com and if bar.example.com as altsvc to that domain the domain will be excluded for foo.example.com.
Differential Revision: https://phabricator.services.mozilla.com/D95845
- Add 2 test: 1) server is not listening to the port and 2) server is not responding that will cause the connection to timeout and fall back to HTTP2
- Adds a server that only reads packets but never sends any to simulate a handshake timing out
Differential Revision: https://phabricator.services.mozilla.com/D95816
Domains are excluded:
- if NS_ERROR_NET_HTTP3_PROTOCOL_ERROR error happens, this is a single error for all different HTTP3 protocol errors,
- also if a connection times out before the handshake is done
Change the current behavior to exclude HTTP3 domains instead of excluding the origin host names. HTTP2 disable AltSvc mapping if a origin domain is excluded which may not be ideal. This patch only changes behavior of HTTP3.
Refactor test_http3_fatal_stream_error.js. The test use to try to connect to http3 server on port 443 that does nto exist and it would return an error. This patch make the test use HTTP2 so that the the connection to the origin host (not AltSvc host) succeeds.
Differential Revision: https://phabricator.services.mozilla.com/D95807
This needs to count encrypted data, therefore it is implemented as a NSPR layer right above the PR_NSPR_IO_LAYER layer.
Differential Revision: https://phabricator.services.mozilla.com/D96083
- Move looping while calling mTransaction->ReadSegments into Http3Stream and call mTransaction->ReadSegmentsAgain. We use to loop in Http3Session which was not easy because it is not easy to find out when to leave the loop. The original code was working, but this is a better way to do this.
- Remove mReadyForWriteButBlocked it is not necessary, it was used only as a double check and can only be a source of bugs.
- Remove mContentBytesWritten, because it is not used.
- Http3Server now reads post data and returns amount of data received (this was needed to make better test).
- In test_http3.js increase the number of parallel to trigger max-concurent-stream limit and test stream queuing before streams being activated.
- Add tests for post with large amount of data that are hitting the stream bugger limits. This is testing Http3Event::Tag::DataWritable and also testing the the end of the mTransaction->ReadSegmentsAgain loop.
Differential Revision: https://phabricator.services.mozilla.com/D95622
- add allowHttp3 attribute to nsIHttpChannelInternal, it is used for easy testing and it will be used for Bug 1674111
- add test for NS_HTTP_DISALLOW_HTTP3 and NS_HTTP_DISALLOW_SPDY
- add HTTP3 test for altSvc and the cert verifiacation
Differential Revision: https://phabricator.services.mozilla.com/D95256
- We have an assumption that SetResponseHeaders will be called before WriteSegments is called for the first time. I would like to make it more structural add add a new state BEFORE_HEADERS
- mDataReceived was never set, which is wrong.
- Almost any error that occurs during ReadResponseData is a connection error and neqo will handle it internally by closing the session. This will be read by necko as ConnectionState change event. Therefore ignore errors received from mHttp3Connection->ReadResponseData and let the ConnectionChange event close the stream.
- This also adds a test. Because the stream has received some data already the transaction will br closed with the NS_ERROR_NET_PARTIAL_TRANSFER error.
Differential Revision: https://phabricator.services.mozilla.com/D94951
This will allow us to make response that violate the Http3 protocol and cause a protocol error.
Currently the server returns only one response, we may extend it if needed.
Differential Revision: https://phabricator.services.mozilla.com/D94912
- This will make handling of responses contain only headers in the same way as the responses with
a response body
- This will also make sure we pick up an error if neqo_http3conn_read_response_data return one.
Differential Revision: https://phabricator.services.mozilla.com/D94834