@@ -39,7 +39,7 @@ public class TimeoutsHolder {
39
39
private volatile NettyResponseFuture <?> nettyResponseFuture ;
40
40
public final Timeout requestTimeout ;
41
41
public volatile Timeout readTimeout ;
42
- private volatile String remoteAddress = "not-connected" ;
42
+ private volatile InetSocketAddress remoteAddress ;
43
43
44
44
public TimeoutsHolder (Timer nettyTimer , NettyResponseFuture <?> nettyResponseFuture , NettyRequestSender requestSender , AsyncHttpClientConfig config ) {
45
45
this .nettyTimer = nettyTimer ;
@@ -66,7 +66,7 @@ public TimeoutsHolder(Timer nettyTimer, NettyResponseFuture<?> nettyResponseFutu
66
66
}
67
67
68
68
public void initRemoteAddress (InetSocketAddress address ) {
69
- remoteAddress = address . toString () ;
69
+ remoteAddress = address ;
70
70
}
71
71
72
72
public void startReadTimeout () {
@@ -82,8 +82,7 @@ void startReadTimeout(ReadTimeoutTimerTask task) {
82
82
// first call triggered from outside (else is read timeout is re-scheduling itself)
83
83
task = new ReadTimeoutTimerTask (nettyResponseFuture , requestSender , this , readTimeoutValue );
84
84
}
85
- Timeout readTimeout = newTimeout (task , readTimeoutValue );
86
- this .readTimeout = readTimeout ;
85
+ this .readTimeout = newTimeout (task , readTimeoutValue );
87
86
88
87
} else if (task != null ) {
89
88
// read timeout couldn't re-scheduling itself, clean up
@@ -109,6 +108,6 @@ private Timeout newTimeout(TimerTask task, long delay) {
109
108
}
110
109
111
110
String remoteAddress () {
112
- return remoteAddress ;
111
+ return remoteAddress == null ? "not-connected" : remoteAddress . toString () ;
113
112
}
114
113
}
0 commit comments