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 528EF10555 for ; Wed, 1 May 2013 12:54:55 +0000 (UTC) Received: (qmail 5324 invoked by uid 500); 1 May 2013 12:54:54 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 4897 invoked by uid 500); 1 May 2013 12:54:54 -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 4861 invoked by uid 99); 1 May 2013 12:54:52 -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 12:54:52 +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 sindhi.for@gmail.com designates 209.85.223.177 as permitted sender) Received: from [209.85.223.177] (HELO mail-ie0-f177.google.com) (209.85.223.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 12:54:45 +0000 Received: by mail-ie0-f177.google.com with SMTP id 9so1850195iec.36 for ; Wed, 01 May 2013 05:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=dmfQHeJYBjhuzwvl0kDN/9FWFm6KJ2VWOIHugccdTz4=; b=nPrv8zF07NqahB0DZ7uOJ8NdSmznlA1kdgSt0GSY+qmS02mfcugQ6wUcsdWr6zAAN3 CSBBjBNfbcmYssIGXBOxadSJnvu1yt/D/qtn6Olltk8GnOed5KEkp2CIzozt14kcN9DG hqVPWm2YvQuH4E51ujpGKW5ChGPpamIZarlqFyTVVQ33mlcLY4VEvT2rkdp+lXiIeOL2 YHhkDYF//QZNoQW5uDZ3y7XDv8/Q+dL91L+LrBcZEiFXhYQTaz1ANHImoUhhP29XWfHH a3U1GWfl2OkLNP1Awq5PEC/Lrj7rnOiSE/7L3IN3Ovk0Ocxr+/O8pCEDYOAtDjsY2eOn mrfA== MIME-Version: 1.0 X-Received: by 10.43.146.3 with SMTP id jw3mr1314455icc.39.1367412864959; Wed, 01 May 2013 05:54:24 -0700 (PDT) Received: by 10.64.93.100 with HTTP; Wed, 1 May 2013 05:54:24 -0700 (PDT) Date: Wed, 1 May 2013 18:24:24 +0530 Message-ID: Subject: Apache Buckets and Brigade From: Sindhi Sindhi To: modules-dev@httpd.apache.org Content-Type: multipart/alternative; boundary=001a11c2e9aa13c9b404dba79ed1 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2e9aa13c9b404dba79ed1 Content-Type: text/plain; charset=ISO-8859-1 Hello, Thanks a lot for providing answers to my earlier emails with subject "Apache C++ equivalent of javax.servlet.Filter". I really appreciate your help. I had another question. My requirement is something like this - I have a huge html file that I have copied into the Apache htdocs folder. In my C++ Apache module, I want to get this html file contents and remove/replace some strings. Say I have a HTML file that has the string "oldString" appearing 3 times in the file. My requirement is to replace "oldString" with the new string "newString". I have already written a C++ function that has a signature like this - char* processHTML(char* inHTMLString) { // char* newHTMLWithNewString = return newHTMLWithNewString; } The above function does a lot more than just string replace, it has lot of business logic implemented and finally returns the new HTML string. I want to call processHTML() inside my C++ Apache module. As I know Apache maintains an internal data structure called Buckets and Brigades which actually contain the HTML file data. My question is, is the entire HTML file content (in my case the html file is huge) residing in a single bucket? Means, when I fetch one bucket at a time from a brigade, can I be sure that the entire HTML file data from to can be found in a single bucket? For ex. if my html file looks like this - .. .. oldString ... oldString...........oldString.. .. When I iterate through all buckets of a brigade, will I find my entire HTML file content in a single bucket OR the HTML file content can be present in multiple buckets, say like this - case1: bucket-1 contents = " .. .. oldString ... oldString...........oldString.. .. " case2: bucket-1 contents = " .. .. oldStr" bucket-2 contents = "ing ... oldString...........oldString.. .. " If its case2, then the the function processHTML() I have written will not work because it searches for the entire string "oldString" and in case2 "oldString" is found only partially. Thanks a lot. --001a11c2e9aa13c9b404dba79ed1--