Skip to content

Commit

Permalink
Merge branch 'main' into fxvpn-32-in-app-message
Browse files Browse the repository at this point in the history
  • Loading branch information
mcleinman committed Nov 14, 2024
2 parents d685da0 + db119df commit c7e3adb
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 118 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/i18n
Submodule i18n updated 1 files
+4 −0 vi/extras.xliff
42 changes: 31 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions extension/socks5proxy/bin/sockslogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,35 @@ void SocksLogger::dataSentReceived(qint64 sent, qint64 received) {
m_rx_bytes.addSample(received);
}

QDebug& SocksLogger::printEventStack(QDebug& msg, Socks5Connection* conn) {
bool first = true;
for (const QString& hostname : conn->hostLookupStack()) {
if (!first) {
msg << "->";
}
first = false;
msg << hostname;
}
return msg;
}

void SocksLogger::connectionStateChanged() {
Socks5Connection* conn = qobject_cast<Socks5Connection*>(QObject::sender());
if (conn->state() == Socks5Connection::Proxy) {
auto msg = qDebug() << "Connecting" << conn->clientName() << "to";
for (const QString& hostname : conn->dnsLookupStack()) {
msg << hostname << "->";
printEventStack(msg, conn);
}
if (conn->state() == Socks5Connection::Closed) {
if (!conn->errorString().isEmpty()) {
// Failed connection
auto msg = qDebug() << "Failed";
printEventStack(msg, conn) << "->" << conn->errorString();
} else {
// Successful connection
auto msg = qDebug() << "Closed";
printEventStack(msg, conn) << "txbuf" << conn->sendHighWaterMark()
<< "rxbuf" << conn->recvHighWaterMark();
}
msg << conn->destAddress().toString();
}
}

Expand Down
1 change: 1 addition & 0 deletions extension/socks5proxy/bin/sockslogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SocksLogger final : public QObject {
~SocksLogger();

static QString bytesToString(qint64 value);
static QDebug& printEventStack(QDebug& msg, Socks5Connection* conn);
void printStatus();

const QString& logfile() const { return m_logFileName; }
Expand Down
Loading

0 comments on commit c7e3adb

Please sign in to comment.