@@ -38,7 +38,7 @@ public class TimeoutsHolder {
38
38
private volatile NettyResponseFuture <?> nettyResponseFuture ;
39
39
public final Timeout requestTimeout ;
40
40
public volatile Timeout readTimeout ;
41
- private volatile String remoteAddress = "not-connected" ;
41
+ private volatile InetSocketAddress remoteAddress ;
42
42
43
43
public TimeoutsHolder (Timer nettyTimer , NettyResponseFuture <?> nettyResponseFuture , NettyRequestSender requestSender , AsyncHttpClientConfig config ) {
44
44
this .nettyTimer = nettyTimer ;
@@ -61,7 +61,7 @@ public TimeoutsHolder(Timer nettyTimer, NettyResponseFuture<?> nettyResponseFutu
61
61
}
62
62
63
63
public void initRemoteAddress (InetSocketAddress address ) {
64
- remoteAddress = address . toString () ;
64
+ remoteAddress = address ;
65
65
}
66
66
67
67
public void startReadTimeout () {
@@ -77,8 +77,7 @@ void startReadTimeout(ReadTimeoutTimerTask task) {
77
77
// first call triggered from outside (else is read timeout is re-scheduling itself)
78
78
task = new ReadTimeoutTimerTask (nettyResponseFuture , requestSender , this , readTimeoutValue );
79
79
}
80
- Timeout readTimeout = newTimeout (task , readTimeoutValue );
81
- this .readTimeout = readTimeout ;
80
+ this .readTimeout = newTimeout (task , readTimeoutValue );
82
81
83
82
} else if (task != null ) {
84
83
// read timeout couldn't re-scheduling itself, clean up
@@ -104,6 +103,6 @@ private Timeout newTimeout(TimerTask task, long delay) {
104
103
}
105
104
106
105
String remoteAddress () {
107
- return remoteAddress ;
106
+ return remoteAddress == null ? "not-connected" : remoteAddress . toString () ;
108
107
}
109
108
}
0 commit comments