22 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
5- #include " obfuscator .h"
5+ #include " qprocessobfuscator .h"
66
77#include < QByteArray>
88#include < QCoreApplication>
@@ -19,11 +19,11 @@ constexpr uint32_t WG_FIREWALL_MARK = 0xca6c;
1919#endif
2020
2121namespace {
22- Logger logger (" Obfuscator " );
22+ Logger logger (" QProcessObfuscator " );
2323}
2424
25- Obfuscator::Obfuscator (const InterfaceConfig& config) {
26- MZ_COUNT_CTOR (Obfuscator );
25+ QProcessObfuscator::QProcessObfuscator (const InterfaceConfig& config) {
26+ MZ_COUNT_CTOR (QProcessObfuscator );
2727
2828 const QStringList args = buildArgs (config);
2929 if (args.isEmpty ()) {
@@ -39,7 +39,7 @@ Obfuscator::Obfuscator(const InterfaceConfig& config) {
3939 m_process.setProcessChannelMode (QProcess::MergedChannels);
4040}
4141
42- bool Obfuscator ::start () {
42+ bool QProcessObfuscator ::start () {
4343 logger.debug () << " Starting obfuscator" ;
4444 m_process.start ();
4545 if (!m_process.waitForStarted (OBFUSCATOR_PROC_TIMEOUT_MS)) {
@@ -72,7 +72,7 @@ bool Obfuscator::start() {
7272 return false ;
7373}
7474
75- quint16 Obfuscator ::parseListeningPort (const QByteArray& line) const {
75+ quint16 QProcessObfuscator ::parseListeningPort (const QByteArray& line) const {
7676 static const QByteArray prefix = " listening on 127.0.0.1:" ;
7777 const int idx = line.indexOf (prefix);
7878 if (idx < 0 ) {
@@ -83,7 +83,7 @@ quint16 Obfuscator::parseListeningPort(const QByteArray& line) const {
8383 return ok ? port : 0 ;
8484}
8585
86- QStringList Obfuscator ::buildArgs (const InterfaceConfig& config) {
86+ QStringList QProcessObfuscator ::buildArgs (const InterfaceConfig& config) {
8787 QStringList args;
8888 switch (config.m_obfuscationMethod ) {
8989 case Server::ObfuscationMethod::UdpOverTcp:
@@ -105,7 +105,7 @@ QStringList Obfuscator::buildArgs(const InterfaceConfig& config) {
105105 return args;
106106}
107107
108- QString Obfuscator ::binaryName () const {
108+ QString QProcessObfuscator ::binaryName () const {
109109#if defined(MZ_WINDOWS)
110110 return QStringLiteral (" mozillavpn-obfuscator.exe" );
111111#elif defined(MZ_LINUX)
@@ -116,8 +116,8 @@ QString Obfuscator::binaryName() const {
116116#endif
117117}
118118
119- Obfuscator ::~Obfuscator () {
120- MZ_COUNT_DTOR (Obfuscator );
119+ QProcessObfuscator ::~QProcessObfuscator () {
120+ MZ_COUNT_DTOR (QProcessObfuscator );
121121 if (m_process.state () == QProcess::NotRunning) {
122122 return ;
123123 }
0 commit comments