Return-Path: Delivered-To: apmail-trafficserver-users-archive@www.apache.org Received: (qmail 25981 invoked from network); 16 Jul 2010 00:33:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jul 2010 00:33:11 -0000 Received: (qmail 32181 invoked by uid 500); 16 Jul 2010 00:33:11 -0000 Delivered-To: apmail-trafficserver-users-archive@trafficserver.apache.org Received: (qmail 32080 invoked by uid 500); 16 Jul 2010 00:33:10 -0000 Mailing-List: contact users-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@trafficserver.apache.org Delivered-To: mailing list users@trafficserver.apache.org Received: (qmail 32072 invoked by uid 99); 16 Jul 2010 00:33:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 00:33:10 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jwieland@gmail.com designates 209.85.212.42 as permitted sender) Received: from [209.85.212.42] (HELO mail-vw0-f42.google.com) (209.85.212.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 00:33:03 +0000 Received: by vws20 with SMTP id 20so1993696vws.29 for ; Thu, 15 Jul 2010 17:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=bF/7AAi359E1jKj/4v6lvQTlGp8bFN114uCegisxcHI=; b=RDOJD+AifZoxgV/vz1kc57ypgFMwq5Qbw2cLgUkHMFlaAVcx+b7JxKLrZl/prgV2wX GxFKmmXXIhaERruMgG4cLRvwIkJ6ghMRWjzpvQ5mwBEiZAF1ZbsujHiB/U2SI8zff+Wb eoogMhWRHcgyLqPaTb0uPiVL3hW4A9Hc7NICI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IXgJZsXzDz7FfS1LPh0gATQ2Lh0E7DO3AfIWOqutoMc2Lr+5DM7+d51J0KpZLst9Fw NOv8C+/uQ6o82bNYvnvMwjc4BCfZRBAQV6tLNhImrPsC3wTv6bueXq3r4i7YaDiyD1Ne nwsCGxdxBadHojMSajcZPHNAlI9NRtTsKMm2s= MIME-Version: 1.0 Received: by 10.220.168.213 with SMTP id v21mr10158vcy.274.1279240301897; Thu, 15 Jul 2010 17:31:41 -0700 (PDT) Received: by 10.220.158.206 with HTTP; Thu, 15 Jul 2010 17:31:41 -0700 (PDT) Date: Thu, 15 Jul 2010 17:31:41 -0700 Message-ID: Subject: help with ats plugins: logging, segfaults and malformed content From: Jason Wieland To: users@trafficserver.apache.org Content-Type: multipart/alternative; boundary=0016e65ae5a0c6e8a6048b7657b5 X-Virus-Checked: Checked by ClamAV on apache.org --0016e65ae5a0c6e8a6048b7657b5 Content-Type: text/plain; charset=ISO-8859-1 Hello group, I'm running an up to date (Revision: 964088) of ATS on 64bit ubuntu using the official ec2 images as a forward proxy. I'm now attempting to write a plugin that will inject a line of html into the body of the response content for every request the proxy serves. ATS is supplied with a bunch of example plugins that give me a great starting point but I'm having a couple problems. 1. I can't seem to get the ' INKDebug("debug-hello", "Hello World!\n");' as log by the hello.so plugin into either stdout or into syslog. I added the following options to records.config, but still no log messages CONFIG proxy.config.diags.output.diag SE CONFIG proxy.config.diags.output.debug SE CONFIG proxy.config.diags.output.status SE CONFIG proxy.config.diags.output.note SE CONFIG proxy.config.diags.output.warning SE CONFIG proxy.config.diags.output.error SE CONFIG proxy.config.diags.output.fatal SE CONFIG proxy.config.diags.output.alert SE CONFIG proxy.config.diags.output.emergency SE 2. I compiled and successfully loaded in hello.so example plugin. However when I load in the null-transform.so plugin I get Segmentation faults after about 3-4 requests: root@ip-10-251-163-xxx:/usr/local# ./bin/traffic_server [TrafficServer] using root directory '/usr/local' [Jul 15 23:44:52.866] {140596841482000} STATUS: opened /usr/local/var/log/trafficserver/diags.log NOTE: Traffic Server received Sig 11: Segmentation fault ./bin/traffic_server - STACK TRACE: Segmentation fault 3. When trying out the example plugin append-transform.so /usr/local/etc/trafficserver/content_injection and the inside the file content_injection I have: foo bar baz About 9 out of 10 times I get just the appended html jwieland@ws-jwieland-lin2:~$ curl -v -x 184.73.156.165:8080 http://www.google.com * About to connect() to proxy 184.73.156.165 port 8080 (#0) * Trying 184.73.156.165... connected * Connected to 184.73.156.165 (184.73.156.165) port 8080 (#0) > GET http://www.google.com HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/ 3.12.6.2 zlib/1.2.3 libidn/1.9 libssh2/1.2.2 > Host: www.google.com > Accept: */* > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < Date: Fri, 16 Jul 2010 00:04:15 GMT < Expires: -1 < Cache-Control: private, max-age=0 < Content-Type: text/html; charset=ISO-8859-1 < Set-Cookie: xxxxxxx < Server: ATS/2.1.2-unstable < X-XSS-Protection: 1; mode=block < Content-Length: 25 < Age: 1 < Proxy-Connection: keep-alive < Via: HTTP/1.1 ip-10-251-163-160 (ApacheTrafficServer/2.1.2-unstable [c sSf ]) < foo bar baz * Connection #0 to host 184.73.156.165 left intact * Closing connection #0 The 1/10 I would get the entire document with the addition. I made sure I restarted the server, I've set the CONFIG proxy.config.http.cache.http INT 0 to make sure I'm not serving up a cached hit. And I'm using curl to make sure it is not a browser cache. Thanks in advance for your help, Jason Wieland --0016e65ae5a0c6e8a6048b7657b5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello group, =A0I'm running an up to date (Revision: 964088) of ATS on = 64bit ubuntu using the official ec2 images as a forward proxy. =A0

=
I'm now attempting to write a plugin that will inject a line= of html into the body of the response content for every request the proxy = serves. =A0ATS is supplied with a bunch of example plugins that give me a g= reat starting point but I'm having a couple problems. =A0

1. I can't seem to get the ' INKDebug("deb= ug-hello", "Hello World!\n");' as log by the hello.so pl= ugin into either stdout or into syslog. =A0I added the following options to= records.config, but still no log messages

CONFIG proxy.config.diags.output.diag SE
CONFIG proxy.config.diags.output.debug SE
CONFIG proxy.config.di= ags.output.status SE
CONFIG proxy.config.diags.output.note SE
CONFIG proxy.config.diags.output.warning SE
CONFIG proxy.con= fig.diags.output.error SE
CONFIG proxy.config.diags.output.fatal = SE
CONFIG proxy.config.diags.output.alert SE
CONFIG pro= xy.config.diags.output.emergency SE


2. I compiled and=A0successfully= =A0loaded in hello.so example plugin. =A0However when I load in the null-tr= ansform.so plugin I get Segmentation faults after about 3-4 requests:
=

root@ip-10-251-163-xxx:/usr/local# ./bin/traffic_server= =A0
[TrafficServer] using root directory '/usr/local'
[Jul 15 23:44:52.866] {140596841482000} STATUS: opened /usr/local/va= r/log/trafficserver/diags.log
NOTE: Traffic Server received Sig 11: Segmentation fault
./b= in/traffic_server - STACK TRACE:=A0
Segmentation fault


3. When trying out the example plugin
append-transform.so /usr/local/etc/trafficserver/content_injection

and the inside the file content_injection I have:
<span>foo bar baz</span>



About 9 out of 10 times I get just the appended h= tml


jwieland@ws-jwieland-lin2:= ~$ curl -v -x 184.73.156.165:8080 http://www.google.com
* About to connect() to proxy 184.73.156.165 port 8080 (#0)
= * =A0 Trying 184.73.156.165... connected
* Connected to 184.73.15= 6.165 (184.73.156.165) port 8080 (#0)
> GET http://www.google.com HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 = NSS/3.12.6.2 zlib/1.2.3 libidn/1.9 libssh2/= 1.2.2
> Accept: */*
> Proxy-Connection: Keep-Alive
>=A0
< HTTP/1.1 200 OK
< Date: Fri, 16 Jul 20= 10 00:04:15 GMT
< Expires: -1
< Cache-Control: pr= ivate, max-age=3D0
< Content-Type: text/html; charset=3DISO-8859-1
< Set-= Cookie: xxxxxxx
< Server: ATS/2.1.2-unstable
< X-= XSS-Protection: 1; mode=3Dblock
< Content-Length: 25
< Age: 1
< Proxy-Connection: keep-alive
< Via:= HTTP/1.1 ip-10-251-163-160 (ApacheTrafficServer/2.1.2-unstable [c sSf ])
<=A0
<span>foo bar baz</span>
* Connection #0 to host 184.73.156.165 left intact
* Closing conn= ection #0

The 1/10 I would get the entire do= cument with the addition. =A0I made sure I restarted the server, I've s= et the=A0

CONFIG proxy.config.http.cache.http INT 0

to make sure I'm not serving up a cached hit. = =A0And I'm using curl to make sure it is not a browser cache.


Thanks in advance for your help,
Jason Wieland
--0016e65ae5a0c6e8a6048b7657b5--