Skip to content

Commit

Permalink
Clarity improvements from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Schwartz committed Jul 31, 2019
1 parent 0727443 commit 89bc335
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void doConnect(Session session, CommandMessage commandMessage) throws IOE
StatsListener listener = null;
try {
if (alwaysSplitHttps && remoteServerPort == HTTPS_PORT) {
listener = splitDirect(upload, download, sessionUpload, socketUpload);
listener = runWithImmediateSplit(upload, download, sessionUpload, socketUpload);
} else {
listener = runPipes(upload, download, remoteServerPort, httpsTimeoutMs(tcpHandshakeMs));
// We consider a termination event as a potentially recoverable failure if
Expand Down Expand Up @@ -479,7 +479,7 @@ private StatsListener splitRetry(final Pipe upload, final Pipe download, final O
* @throws InterruptedException if this thread is interrupted.
* @throws IOException if the first upstream transfer failed.
*/
private StatsListener splitDirect(final Pipe upload, final Pipe download,
private StatsListener runWithImmediateSplit(final Pipe upload, final Pipe download,
final InputStream client, final OutputStream server)
throws InterruptedException, IOException {
byte[] buf = new byte[chooseLimit()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class SocksServer extends BasicSocksProxyServer {

private final Context context;

// Whether to attempt to fix connectivity on networks with broken TLS behavior.
// If true, we tell the SocksHandler to use first-segment splitting for all HTTPS connections.
private boolean useTlsWorkaround = false;
void enableTlsWorkaround(boolean v) {
useTlsWorkaround = v;
Expand Down

0 comments on commit 89bc335

Please sign in to comment.