Skip to content

Commit

Permalink
Clarify name and generalize reported event
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Schwartz committed Aug 1, 2019
1 parent 89bc335 commit 8249fe1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ private static int httpsTimeoutMs(int tcpHandshakeMs) {
}

// If true, apply splitting on HTTPS automatically, without waiting for an error condition.
private boolean alwaysSplitHttps = false;
void setAlwaysSplitHttps(boolean v) {
alwaysSplitHttps = v;
private boolean alwaysSplitClientHello = false;
void setAlwaysSplitClientHello(boolean v) {
alwaysSplitClientHello = v;
}

@Override
Expand Down Expand Up @@ -143,7 +143,7 @@ public void doConnect(Session session, CommandMessage commandMessage) throws IOE

StatsListener listener = null;
try {
if (alwaysSplitHttps && remoteServerPort == HTTPS_PORT) {
if (alwaysSplitClientHello && remoteServerPort == HTTPS_PORT) {
listener = runWithImmediateSplit(upload, download, sessionUpload, socketUpload);
} else {
listener = runPipes(upload, download, remoteServerPort, httpsTimeoutMs(tcpHandshakeMs));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void initializeSocksHandler(SocksHandler socksHandler) {
OverrideSocksHandler override = (OverrideSocksHandler)socksHandler;
override.setDns(fakeDns, trueDns);
override.setContext(context);
override.setAlwaysSplitHttps(useTlsWorkaround);
override.setAlwaysSplitClientHello(useTlsWorkaround);

} else {
LogWrapper.log(Log.WARN, LOG_TAG, "Foreign handler");
Expand Down
6 changes: 4 additions & 2 deletions Android/app/src/main/java/app/intra/net/socks/TLSProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ private static Result probe(String spec) {

static Result run(Context context, String url) {
Result r = probe(url);
if (r == Result.TLS_FAILED && context != null) {
FirebaseAnalytics.getInstance(context).logEvent(Names.TLS_FAILED.name(), new Bundle());
if (context != null) {
Bundle b = new Bundle();
b.putString(Names.RESULT.name(), r.name());
FirebaseAnalytics.getInstance(context).logEvent(Names.TLS_PROBE.name(), b);
}
return r;
}
Expand Down
2 changes: 1 addition & 1 deletion Android/app/src/main/java/app/intra/sys/Names.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public enum Names {
SPLIT,
TCP_HANDSHAKE_MS,
TIMEOUT,
TLS_FAILED,
TLS_PROBE,
TRANSACTION,
TRY_ALL_ACCEPTED,
TRY_ALL_CANCELLED,
Expand Down

0 comments on commit 8249fe1

Please sign in to comment.