fix: keep mpv relay routes isolated
This commit is contained in:
@@ -29,11 +29,20 @@ private:
|
||||
struct ConnectionState {
|
||||
QByteArray buffer;
|
||||
QNetworkReply *reply = nullptr;
|
||||
QString routeToken;
|
||||
QUrl targetUrl;
|
||||
QString serverId;
|
||||
bool headersSent = false;
|
||||
bool headOnly = false;
|
||||
bool upstreamFinished = false;
|
||||
};
|
||||
|
||||
struct RouteState {
|
||||
QUrl targetUrl;
|
||||
QString serverId;
|
||||
QNetworkProxy proxy;
|
||||
};
|
||||
|
||||
void onNewConnection();
|
||||
void onSocketReadyRead(QTcpSocket *socket);
|
||||
void onSocketDisconnected(QTcpSocket *socket);
|
||||
@@ -43,6 +52,7 @@ private:
|
||||
void writeError(QTcpSocket *socket, int statusCode, const QByteArray &message);
|
||||
void closeConnection(QTcpSocket *socket);
|
||||
void recordRelayedBytes(qint64 bytes);
|
||||
void cleanupUnusedRoutes();
|
||||
|
||||
static QByteArray reasonPhrase(int statusCode);
|
||||
static bool isHopByHopHeader(QByteArray name);
|
||||
@@ -51,6 +61,7 @@ private:
|
||||
QNetworkAccessManager *m_network = nullptr;
|
||||
QTimer *m_speedTimer = nullptr;
|
||||
QHash<QTcpSocket *, ConnectionState> m_connections;
|
||||
QHash<QString, RouteState> m_routes;
|
||||
QUrl m_targetUrl;
|
||||
QString m_serverId;
|
||||
QString m_streamToken;
|
||||
|
||||
Reference in New Issue
Block a user