|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <NTRIPHttpSession.h>
Inheritance diagram for NTRIPHttpSession:
Collaboration diagram for NTRIPHttpSession:Signals | |
| void | certificatePinned (const QString &pin) |
| A newly trusted self-signed certificate, as NTRIPConnectionConfig::pinnedCertificate; precedes the request. | |
| void | responseStarted () |
| The caster accepted the request; its body follows. | |
| void | bodyReceived (const QByteArray &body, qint64 receivedAtMs) |
| Body bytes, with the scheduler time at which the bytes carrying them arrived. | |
| void | failed (const NTRIPFailure &failure) |
| A socket, TLS or HTTP failure, including an error status with the caster's explanation. | |
| void | finished () |
| The response ended where its HTTP framing allows. | |
Public Member Functions | |
| NTRIPHttpSession (QObject *parent=nullptr, RuntimeScheduler *scheduler=nullptr, NTRIPHttpPurpose purpose=NTRIPHttpPurpose::Corrections) | |
| QString | open (const NTRIPConnectionConfig &config) |
| bool | write (const QByteArray &bytes) |
| False unless the socket accepted every byte; the owner decides how to report it. | |
| bool | isConnected () const |
| bool | awaitingErrorBody () const |
| An error status arrived and its body is still being read. | |
| void | abort () |
| Ends the connection without further signals. | |
| void | retire () |
Static Public Attributes | |
| static constexpr qint64 | READ_BUFFER_BYTES = 64 * 1024 |
| static constexpr qint64 | READ_CHUNK_BYTES = 16 * 1024 |
| static constexpr std::chrono::milliseconds | ERROR_BODY_TIMEOUT {250} |
Friends | |
| class | NTRIPHttpSessionTest |
| class | NTRIPHttpTransportTest |
One HTTP exchange with a caster over TCP or TLS, shared by the correction stream and source-table fetches: it sends the request once connected and decodes the response. responseStarted() precedes the body, which arrives through bodyReceived(); the exchange ends with at most one failed() or finished(), and abort() and retire() end it silently. An error status waits up to ERROR_BODY_TIMEOUT for the caster's explanation in its body. Observers may abort or retire the session from any of its signals, but must not delete it there: the signal is delivered from inside the session's socket, which deleting the session would destroy mid-emission.
With the self-signed opt-in, the first self-signed certificate accepted from a host:port is pinned; later connections accept a self-signed certificate only if it matches the configured pin.
Definition at line 31 of file NTRIPHttpSession.h.
|
explicit |
Definition at line 18 of file NTRIPHttpSession.cc.
| void NTRIPHttpSession::abort | ( | ) |
Ends the connection without further signals.
Definition at line 252 of file NTRIPHttpSession.cc.
Referenced by retire().
|
inline |
An error status arrived and its body is still being read.
Definition at line 53 of file NTRIPHttpSession.h.
References NTRIPHttpDecoder::awaitingErrorBody().
|
signal |
Body bytes, with the scheduler time at which the bytes carrying them arrived.
|
signal |
A newly trusted self-signed certificate, as NTRIPConnectionConfig::pinnedCertificate; precedes the request.
|
signal |
A socket, TLS or HTTP failure, including an error status with the caster's explanation.
|
signal |
The response ended where its HTTP framing allows.
| bool NTRIPHttpSession::isConnected | ( | ) | const |
Definition at line 158 of file NTRIPHttpSession.cc.
| QString NTRIPHttpSession::open | ( | const NTRIPConnectionConfig & | config | ) |
Connects once and sends the request of the session's purpose when connected; later calls are ignored. Returns why config cannot build a request, without connecting, or empty.
Definition at line 26 of file NTRIPHttpSession.cc.
References NTRIPHttpRequest::build(), NTRIPHttpRequest::bytes, config, QGCNetworkHelper::createSslConfig(), and NTRIPHttpRequest::error.
Referenced by NTRIPHttpTransport::start().
|
signal |
The caster accepted the request; its body follows.
| void NTRIPHttpSession::retire | ( | ) |
Detaches from its owning parent, aborts, and deletes the session later, so abort observers cannot reach the owner.
Definition at line 260 of file NTRIPHttpSession.cc.
References abort().
| bool NTRIPHttpSession::write | ( | const QByteArray & | bytes | ) |
False unless the socket accepted every byte; the owner decides how to report it.
Definition at line 149 of file NTRIPHttpSession.cc.
|
friend |
Definition at line 34 of file NTRIPHttpSession.h.
|
friend |
Definition at line 35 of file NTRIPHttpSession.h.
|
staticconstexpr |
Definition at line 40 of file NTRIPHttpSession.h.
|
staticconstexpr |
Definition at line 38 of file NTRIPHttpSession.h.
|
staticconstexpr |
Definition at line 39 of file NTRIPHttpSession.h.