@@ -600,7 +600,7 @@ public ManagedHttpClientConnection create(HttpRoute route,
600
600
DEFAULT_BUFSIZE , chardecoder , charencoder ,
601
601
cconfig .getMessageConstraints (), null , null ,
602
602
DefaultHttpRequestWriterFactory .INSTANCE ,
603
- DefaultHttpResponseParserFactory .INSTANCE );
603
+ DefaultHttpResponseParserFactory .INSTANCE , curi );
604
604
}
605
605
};
606
606
BasicHttpClientConnectionManager connMan = new BasicHttpClientConnectionManager (
@@ -618,6 +618,7 @@ protected static class RecordingHttpClientConnection extends DefaultBHttpClientC
618
618
619
619
private static final AtomicLong COUNTER = new AtomicLong ();
620
620
private String id ;
621
+ private final CrawlURI curi ;
621
622
622
623
public RecordingHttpClientConnection (
623
624
final int buffersize ,
@@ -628,15 +629,17 @@ public RecordingHttpClientConnection(
628
629
final ContentLengthStrategy incomingContentStrategy ,
629
630
final ContentLengthStrategy outgoingContentStrategy ,
630
631
final HttpMessageWriterFactory <HttpRequest > requestWriterFactory ,
631
- final HttpMessageParserFactory <HttpResponse > responseParserFactory ) {
632
+ final HttpMessageParserFactory <HttpResponse > responseParserFactory , CrawlURI curi ) {
632
633
super (buffersize , fragmentSizeHint , chardecoder , charencoder ,
633
634
constraints , incomingContentStrategy , outgoingContentStrategy ,
634
635
requestWriterFactory , responseParserFactory );
635
636
id = "recording-http-connection-" + Long .toString (COUNTER .getAndIncrement ());
637
+ this .curi = curi ;
636
638
}
637
639
638
640
@ Override
639
641
protected InputStream getSocketInputStream (final Socket socket ) throws IOException {
642
+ curi .setServerIP (socket .getInetAddress ().getHostAddress ());
640
643
Recorder recorder = Recorder .getHttpRecorder ();
641
644
if (recorder != null ) { // XXX || (isSecure() && isProxied())) {
642
645
return recorder .inputWrap (super .getSocketInputStream (socket ));
0 commit comments