[ 
https://issues.apache.org/jira/browse/TS-4591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15444899#comment-15444899
 ] 

Gota Adachi commented on TS-4591:
---------------------------------

OK, I identified the problem.
{noformat}
$ diff -U2 trafficserver-5.3.x/proxy/http/HttpTransact.cc 
trafficserver-6.2.x/proxy/http/HttpTransact.cc 
--- trafficserver-5.3.x/proxy/http/HttpTransact.cc      2016-04-26 
08:07:57.000000000 +0900
+++ trafficserver-6.2.x/proxy/http/HttpTransact.cc      2016-08-29 
09:13:14.430137936 +0900
...
@@ -3069,5 +3179,4 @@
 }
 
-
 ///////////////////////////////////////////////////////////////////////////////
 // Name       : HandleICPLookup
@@ -3089,13 +3198,13 @@
   SET_VIA_STRING(VIA_DETAIL_CACHE_TYPE, VIA_DETAIL_ICP);
   if (s->icp_lookup_success == true) {
-    HTTP_INCREMENT_TRANS_STAT(http_icp_suggested_lookups_stat);
+    HTTP_INCREMENT_DYN_STAT(http_icp_suggested_lookups_stat);
     DebugTxn("http_trans", "[HandleICPLookup] Success, sending request to icp 
suggested host.");
-    ats_ip4_set(&s->icp_info.addr, s->icp_ip_result.sin_addr.s_addr);
-    s->icp_info.port = ntohs(s->icp_ip_result.sin_port);
+    ats_ip4_set(&s->icp_info.dst_addr, s->icp_ip_result.sin_addr.s_addr);
+    s->icp_info.dst_addr.port() = ntohs(s->icp_ip_result.sin_port);
 
     // TODO in this case we should go to the miss case
     // just a little shy about using goto's, that's all.
-    ink_release_assert((s->icp_info.port != s->client_info.port) ||
-                       (ats_ip_addr_cmp(&s->icp_info.addr.sa, 
&Machine::instance()->ip.sa) != 0));
+    ink_release_assert((s->icp_info.dst_addr.port() != 
s->client_info.dst_addr.port()) ||
+                       (ats_ip_addr_cmp(&s->icp_info.dst_addr.sa, 
&Machine::instance()->ip.sa) != 0));
 
     // Since the ICPDNSLookup is not called, these two
@@ -3119,8 +3228,8 @@
...
{noformat}
_s->icp_ip_result.sin_port_ don't need to convert using *ntohs()* to contain 
_s->icp_info.dst_addr.port()_.
probably these values are same type.

Patch for 6.2.x is below:
{noformat}
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 62954c6..f5f6924 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3200,7 +3200,7 @@ HttpTransact::HandleICPLookup(State *s)
     HTTP_INCREMENT_DYN_STAT(http_icp_suggested_lookups_stat);
     DebugTxn("http_trans", "[HandleICPLookup] Success, sending request to icp 
suggested host.");
     ats_ip4_set(&s->icp_info.dst_addr, s->icp_ip_result.sin_addr.s_addr);
-    s->icp_info.dst_addr.port() = ntohs(s->icp_ip_result.sin_port);
+    s->icp_info.dst_addr.port() = s->icp_ip_result.sin_port;
 
     // TODO in this case we should go to the miss case
     // just a little shy about using goto's, that's all.
{noformat}

Tested on my environment, it looks like works ok.
{noformat}
Aug 29 12:37:01 dev00 traffic_server[16966]: {0x2aad488bd040} DEBUG: 
<HttpSM.cc:4693 (do_http_server_open)> (http) [28] open connection to 
192.168.56.215: 192.168.56.215:8080

1472441847.012 79923 127.0.0.1 TCP_MISS/200 6 GET 
http://test1.example.jp/test/test3.html - SIBLING_HIT/192.168.56.215 text/html -
{noformat}


> Does ICP still works?
> ---------------------
>
>                 Key: TS-4591
>                 URL: https://issues.apache.org/jira/browse/TS-4591
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: ICP
>            Reporter: zhxiaom5
>            Assignee: Bryan Call
>              Labels: regresion
>             Fix For: 7.0.0
>
>
> I use traffic server - 6.1.1, and configure icp below
> ICP.config
> slave|192.168.208.3|2|8088|3130|0|0.0.0.0|1|
> I debug tcp, it seems works fine
> [Jun 27 15:46:43.594] Server {0x2b0fde221700} DEBUG: (icp) [ICP_START] 
> ICP_OP_QUERY for [http://xxx/x.url], Id=3573
> [Jun 27 15:46:43.594] Server {0x2b0fde221700} DEBUG: (icp) 
> [ICP_QUEUE_REQUEST] Id=3573 send query to [192.168.208.2:3130]
> [Jun 27 15:46:43.594] Server {0x2b0fde221700} DEBUG: (icp) 
> [ICP_QUEUE_REQUEST] Id=3573 expected replies=1
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) Response for 
> Id=3573, from [192.168.208.2:3130]
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) Passing Reply for 
> ICP Id=3573
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) 
> [ICP_AWAITING_RESPONSE] Id=3573
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) ICP Response HIT 
> for Id=3573 from [192.168.208.2:3130] return [192.168.208.2:8088]
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) 
> [ICP_DEQUEUE_REQUEST] Id=3573
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) 
> [ICP_POST_COMPLETION] Id=3573
> [Jun 27 15:46:43.612] Server {0x2b0fdea29700} DEBUG: (icp) 
> [ICP_REQUEST_NOT_ACTIVE] Id=3573
> and i also configure remap.config file,but seems it still use origin 
> server,not icp



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to