Move MTProxy policy engine from tgnet/ to self-contained jni/mtproxy/ module. Consolidate reconnect hold computation into single MtProxyRetryAuthority owner (was split across Connection, ConnectionSocket, endpoint policy, and probe coordinator, causing hold misalignment bugs). Add MtProxyTerminalDiagnostic module with host tests for pre-I/O verdict preservation (fixes 02.07/30.06 clobber livelocks). Auto-generate phase classification (isPreIoTerminalVerdict, needsReconnectBackoff, isObservationFacadePhase, isLocalSchedulerTimeout) from single Python contract into both C++ and Java to eliminate parallel maintenance. Pass native hold (coordinator terminal hold + endpoint cooldown) via JNI to Java so reconnect timer and health store use THE clock, not re-derived ones. Optimize log flushing: batch debug lines, flush errors immediately. Add module boundary guard, host build system (MSVC), and unit tests for retry logic and terminal diagnostic derivation.
31 lines
1,021 B
C++
31 lines
1,021 B
C++
#ifndef MTPROXYHANDSHAKEPLAN_H
|
|
#define MTPROXYHANDSHAKEPLAN_H
|
|
|
|
#include "MtProxyAdaptivePolicy.h"
|
|
|
|
#include <string>
|
|
|
|
struct MtProxyHandshakePlan {
|
|
MtProxyAdaptivePolicy::RecipeCursor cursor;
|
|
MtProxyAdaptivePolicy::CompatibilityRecipe recipe;
|
|
std::string recipeId;
|
|
std::string endpointKey;
|
|
std::string probeKey;
|
|
std::string clientHelloSni;
|
|
int32_t tlsProfile = 0;
|
|
int32_t clientHelloFragmentation = 0;
|
|
int32_t serverHelloParserMode = 0;
|
|
int32_t recordSizingMode = 0;
|
|
int32_t timingMode = 0;
|
|
int32_t startupCoverMode = 0;
|
|
bool fakeTls = false;
|
|
bool greaseProbe = false;
|
|
bool greaseSupported = false;
|
|
};
|
|
|
|
MtProxyHandshakePlan mtProxyBuildHandshakePlan(const MtProxyAdaptivePolicy::RecipeInput &input,
|
|
const MtProxyAdaptivePolicy::RecipeCursor &cursor,
|
|
const std::string &endpointKey,
|
|
const std::string &probeKey);
|
|
|
|
#endif
|