Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DB4CFE5F for ; Wed, 1 May 2013 16:42:02 +0000 (UTC) Received: (qmail 20441 invoked by uid 500); 1 May 2013 16:42:02 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 20385 invoked by uid 500); 1 May 2013 16:42:02 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 20375 invoked by uid 99); 1 May 2013 16:42:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 16:42:02 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jmarantz@google.com designates 209.85.219.53 as permitted sender) Received: from [209.85.219.53] (HELO mail-oa0-f53.google.com) (209.85.219.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 16:41:55 +0000 Received: by mail-oa0-f53.google.com with SMTP id m6so1605138oag.12 for ; Wed, 01 May 2013 09:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=4tfgs/6jXRmXI8geI45WAydkvPMPuKqHTVfrfnzKdGA=; b=TE0SGm94EJsxFKt3701VCQV7K/FC0rr9ES/c1+1WO8q+5gej/OOfQOqHY2XpkJ1/7g l0tZCyFMprL+YZd604zUUPotbr+0Ov8FX/2kBOYEUFkQ9i6881lEY94VK9uFQZ015BLX IqLjpBdpeU0FvDITFwvYvXLZPH+fI29164daGxgNjC1MQV/s8aQerxvfP09hn/HDiyCy /N1DA3OXfD+LkGgXH8L56N20dpguJ/tmISMYT51Uq7sSCbmDfZviRIN87EPEdmHEW5ON b4yh94rYsKY7cVU1kaTuPg1ZFP0cPQb5BAlvqOFJRPt/Os8BJhvRdDFAh3YiSqrqORrz VKgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:x-gm-message-state; bh=4tfgs/6jXRmXI8geI45WAydkvPMPuKqHTVfrfnzKdGA=; b=FfC5NEBwKvlRBqNQF+4N6oCGXibpfi4owxSnv6z2OCjUJNwEp86AJvbg+yYkS9H7/j QVTWY+9tBHPK/myIBITzfuXyGOVqZBfj5laS26WN/K2GX4FjcPlesIs+RUEpf/mglnTV ZgTKRAX7ce8acMSOMCo5+/zJONjNAiRdNxoIS/C924AntsdlepBfkSMMy77FwZh8bCvk BraE/k4BHrpZhEFz37oyI4Gu0maG5BPmIAR0Q5dnuOFMysPDAGiW2Rx9XrDTk7Peqb1f puzIuMXzVa7UgJYK9QZftuTYCKDUrvP0APweqyBbRgm+yCxndf1x7SxSEMDa1QH8+Him zdXw== X-Received: by 10.60.94.244 with SMTP id df20mr823841oeb.122.1367426494001; Wed, 01 May 2013 09:41:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.20.107 with HTTP; Wed, 1 May 2013 09:41:13 -0700 (PDT) In-Reply-To: References: <01F77544-0720-4DDA-AF74-289BA1758B93@jaguNET.com> From: Joshua Marantz Date: Wed, 1 May 2013 12:41:13 -0400 Message-ID: Subject: Re: Apache Buckets and Brigade To: "modules-dev@httpd.apache.org" Content-Type: multipart/alternative; boundary=089e011845f86f2b5c04dbaaca30 X-Gm-Message-State: ALoCoQmqSP8Uj1eGUEgfBaIKwiffWZuedy9QxQqLp7WmXyJvQMDHTNyzP6r0HcClP4pqj4ylJvlBS0QRLQEkhUwcpPp76eL/8e4qw0RVj7mnMfh946G7p8yjXyl/LaClhCBJtlVX9HojNz5KOQ0oYVPkWBrpzyF3sJloIGIiHWFBnIVSN/LWZ6N+PeM+sP6/CGGrbGa00BvEt0fRb/ovW3wW5awaX1e68w== X-Virus-Checked: Checked by ClamAV on apache.org --089e011845f86f2b5c04dbaaca30 Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 1, 2013 at 12:14 PM, Sindhi Sindhi wrote: > Thanks to all for the reply. > > Josh, the concern I mentioned was, we may not want mod_pagespeed to modify > the in-memory HTML content. The only change we may want to see in our HTML > will be that the old strings are replaced by the new strings after applying > our business logic which is already done by the C++ filter module I have > written. This C++ filter implements all our business logic and takes an > input buffer that is expected to be the entire HTML file content. So the > Yeah the filter I gave you gives you only a block of HTML characters. E.g. if you have
a b c d e f
then you'll get this as 3 calls to Characters: "a b c d ", "e", and " f". Other than that, the Characters method I pointed you to has exactly the interface you asked for: it gets you an entire block of HTML text in one modifiable std::string which you can mutate at will. And it irons out all the brigade stuff for you. You can configure mod_pagespeed to run just one filter so no other modifications are made. But it looks like you probably need to read Nick's book. You can also read mod_deflate.c or one of the other content-modifying filters such as mod_sed or mod_substitute. -Josh --089e011845f86f2b5c04dbaaca30--