trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil J <anilj.mail...@gmail.com>
Subject Re: Server Transform example code.
Date Wed, 01 May 2013 03:20:47 GMT
Hi List,

Can someone provide your comment on this?

As per my understanding, when transformation vconnection transforms the
data received in the HTTP response message, it has to write it to the
"output buffer" of the output VIO.

When it has to start the compression, it calls the transform_connect()
function. In this function, I am not able to understand where this writing
to the "output buffer" is taking place before transformed data is sent to
the requesting client.

/anil.


On Mon, Apr 29, 2013 at 10:04 AM, Anil J <anilj.mailing@gmail.com> wrote:

> This transformation takes place transform_buffer_event() handler
> function, when the data from the upstream is completely copied into
> the input buffer is by the continuation TSCont from write VIO.
>
> In the transform_connect() function, there is a communication with the
> remote server (socket call) as below.
>
>     200   /* TODO: This only supports IPv4, probably should be changed at
> some point, but
>     201      it's an example ... */
>     202   memset(&ip_addr, 0, sizeof(ip_addr));
>     203   ip_addr.sin_family = AF_INET;
>     204   ip_addr.sin_addr.s_addr = server_ip; /* Should be in network
> byte order */
>     205   ip_addr.sin_port = server_port;
>     206   action = TSNetConnect(contp, (struct sockaddr const*)&ip_addr);
>     207
>
> I am not able to understand as this does not seems to be actually sending
> data to the server over this socket. So when the response from socket
> (server) is indeed received, where that data will be handled to send to the
> proxy client?
>
> Thanks,
> /anil.
>
> On Mon, Apr 29, 2013 at 12:58 AM, Anil J <anilj.mailing@gmail.com> wrote:
>
>> Hi List,
>>
>> In the server transform example code, transform_connect() function
>> invokes the (dummy) call to the remote server where the content is getting
>> transformed. In real implementation of this functionality, will this call
>> with the transformation server be synchronous or asynchronous?
>>
>> I am trying to understand, when the remote server returns the transformed
>> content, how it will be handled to be put back into the HTTP response
>> message? Can you please elaborate this part a bit?
>>
>> I also noted that the explanation given in developer's guide and the code
>> are bit different.
>>
>> Thanks,
>> Anil.
>>
>>
>

Mime
View raw message