Fix RealConnection to guard allocationLimit by connectionPool. #3078

Merged
merged 1 commit into from Jan 2, 2017

Projects

None yet

2 participants

@swankjesse
Contributor

I'm working towards making OkHttp limit itself to a single HTTP/2 connection
to a single host. In this work I found we're not sufficiently safe on
allocationLimit - connections are added to the pool when this is 0, and
the value is updated without any synchronization.

This change also reduces the visibility of some connection fields in
RealConnection and organizes the fields into two sets: those that are
immutable after connect and those that are guarded by connectionPool.

#373

@swankjesse swankjesse Fix RealConnection to guard allocationLimit by connectionPool.
I'm working towards making OkHttp limit itself to a single HTTP/2 connection
to a single host. In this work I found we're not sufficiently safe on
allocationLimit - connections are added to the pool when this is 0, and
the value is updated without any synchronization.

This change also reduces the visibility of some connection fields in
RealConnection and organizes the fields into two sets: those that are
immutable after connect and those that are guarded by connectionPool.

#373
8331b2d
@swankjesse swankjesse merged commit de8699b into master Jan 2, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment