[squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Eliezer Croitoru
I have been working from time to time on StoreID while I believe it useful
for targeted scenarios.

I can test and write different code but wanted to first ask since my memory
is a bit vauge.

 

Squid during it's client side callouts:

Runs a series of tests at:

https://github.com/squid-cache/squid/blob/d2a6dcba707c15484c255e7a569b90f7f1
186383/src/client_side_request.cc#L1723

 

https://github.com/squid-cache/squid/blob/d2a6dcba707c15484c255e7a569b90f7f1
186383/src/client_side_request.cc#L1750

 

>From what I understood this section and others are running in
a-synchronically.

So from my point of view now I understand that if I will use a request mod
ICAP service to inject a request header into the request
It would be available as a StoreID extra ie I can use:

 

store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp %{X-Store-Id}>h"

 

and I will be able to "send" the StoreID helper an extra header which can be
considered while returning squid the right StoreID.

If it's indeed true, is it possible to pass an ICAP response header into the
store_id_extras?

 

Thanks,

Eliezer

 



Eliezer Croitoru  
Linux System Administrator
Mobile: +972-5-28704261
Email: elie...@ngtech.co.il



 

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Alex Rousskov
On 07/12/2018 03:16 AM, Eliezer Croitoru wrote:
> is it possible to pass an ICAP response header into the store_id_extras?

Yes, %adapt::https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence

Alex.
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Eliezer Croitoru
I don't really understand how am I supposed to use it.
With regular logformat I am using:
%{X-Store-Id}>ha

And it works perfect.

So I tried using the next config line for store id:
store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp %{X-Store-Id}>ha"

which didn't worked as expected since it sends always "-".
I have now tried to understand what and how I should use the:
%adapt::mailto:rouss...@measurement-factory.com] 
Sent: Thursday, July 12, 2018 7:01 PM
To: Eliezer Croitoru ; squid-dev@lists.squid-cache.org
Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

On 07/12/2018 03:16 AM, Eliezer Croitoru wrote:
> is it possible to pass an ICAP response header into the store_id_extras?

Yes, %adapt::https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence

Alex.

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Alex Rousskov
On 07/12/2018 11:21 AM, Eliezer Croitoru wrote:

> With regular logformat I am using:
> %{X-Store-Id}>ha
> 
> And it works perfect.

%>ha does not log an ICAP response header. It logs an HTTP request
header. You asked about an ICAP response header.


> So I tried using the next config line for store id:
> store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp %{X-Store-Id}>ha"
> 
> which didn't worked as expected since it sends always "-".

Bugs notwithstanding, the above should work if your adaptation service
adds an X-Store-ID request header field to the adapted HTTP request. You
can check what headers Squid has for %>ha by specifying %>ha without any
parameters.


> I have now tried to understand what and how I should use the:
> %adapt:: -Original Message-
> From: Alex Rousskov [mailto:rouss...@measurement-factory.com] 
> Sent: Thursday, July 12, 2018 7:01 PM
> To: Eliezer Croitoru ; squid-dev@lists.squid-cache.org
> Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?
> 
> On 07/12/2018 03:16 AM, Eliezer Croitoru wrote:
>> is it possible to pass an ICAP response header into the store_id_extras?
> 
> Yes, %adapt:: 
> https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence
> 
> Alex.
> 

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Eliezer Croitoru
I tried it both on access logs and store_id_extras.
In the access log I am receiving this:
ICAP-Header-Test: "Connection: close\r\nDate: Thu, 12 Jul 2018 20:42:04 
GMT\r\nEncapsulated: req-hdr=0, null-body=1189\r\nIstag: 
YTGV-Predictor\r\nService: YouTube GoogleVideo Predictor ICAP serivce\r\n "

But on store_id_extras I am receiving for the same logformat ie
store_id_extras "%adapt::mailto:rouss...@measurement-factory.com] 
Sent: Thursday, July 12, 2018 11:10 PM
To: squid-dev@lists.squid-cache.org
Cc: Eliezer Croitoru 
Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

On 07/12/2018 11:21 AM, Eliezer Croitoru wrote:

> With regular logformat I am using:
> %{X-Store-Id}>ha
> 
> And it works perfect.

%>ha does not log an ICAP response header. It logs an HTTP request
header. You asked about an ICAP response header.


> So I tried using the next config line for store id:
> store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp %{X-Store-Id}>ha"
> 
> which didn't worked as expected since it sends always "-".

Bugs notwithstanding, the above should work if your adaptation service
adds an X-Store-ID request header field to the adapted HTTP request. You
can check what headers Squid has for %>ha by specifying %>ha without any
parameters.


> I have now tried to understand what and how I should use the:
> %adapt:: -Original Message-
> From: Alex Rousskov [mailto:rouss...@measurement-factory.com] 
> Sent: Thursday, July 12, 2018 7:01 PM
> To: Eliezer Croitoru ; squid-dev@lists.squid-cache.org
> Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?
> 
> On 07/12/2018 03:16 AM, Eliezer Croitoru wrote:
>> is it possible to pass an ICAP response header into the store_id_extras?
> 
> Yes, %adapt:: 
> https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence
> 
> Alex.
> 


___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?

2018-07-12 Thread Alex Rousskov
On 07/12/2018 02:47 PM, Eliezer Croitoru wrote:
> I tried it both on access logs and store_id_extras.
> In the access log I am receiving this:
> ICAP-Header-Test: "Connection: close\r\nDate:...\r\n "
> 
> But on store_id_extras I am receiving for the same logformat ie
> store_id_extras "%adapt:: "... -"

Sounds like a Squid bug to me.

Alex.



> -Original Message-
> From: Alex Rousskov [mailto:rouss...@measurement-factory.com] 
> Sent: Thursday, July 12, 2018 11:10 PM
> To: squid-dev@lists.squid-cache.org
> Cc: Eliezer Croitoru 
> Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?
> 
> On 07/12/2018 11:21 AM, Eliezer Croitoru wrote:
> 
>> With regular logformat I am using:
>> %{X-Store-Id}>ha
>>
>> And it works perfect.
> 
> %>ha does not log an ICAP response header. It logs an HTTP request
> header. You asked about an ICAP response header.
> 
> 
>> So I tried using the next config line for store id:
>> store_id_extras "%>a/%>A %un %>rm myip=%la myport=%lp %{X-Store-Id}>ha"
>>
>> which didn't worked as expected since it sends always "-".
> 
> Bugs notwithstanding, the above should work if your adaptation service
> adds an X-Store-ID request header field to the adapted HTTP request. You
> can check what headers Squid has for %>ha by specifying %>ha without any
> parameters.
> 
> 
>> I have now tried to understand what and how I should use the:
>> %adapt:: 
> Yes, %adapt:: header. Have you tried specified that logformat code, without any
> parameters?
> 
> 
> HTH,
> 
> Alex.
> 
> 
> 
> 
>> -Original Message-
>> From: Alex Rousskov [mailto:rouss...@measurement-factory.com] 
>> Sent: Thursday, July 12, 2018 7:01 PM
>> To: Eliezer Croitoru ; squid-dev@lists.squid-cache.org
>> Subject: Re: [squid-dev] StoeiD and ICAP services callouts, when it happens?
>>
>> On 07/12/2018 03:16 AM, Eliezer Croitoru wrote:
>>> is it possible to pass an ICAP response header into the store_id_extras?
>>
>> Yes, %adapt::>
>> https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence
>>
>> Alex.
>>
> 

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev