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 AC455B9BC for ; Mon, 16 Jan 2012 16:38:49 +0000 (UTC) Received: (qmail 64626 invoked by uid 500); 16 Jan 2012 16:38:49 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 64494 invoked by uid 500); 16 Jan 2012 16:38:48 -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 64486 invoked by uid 99); 16 Jan 2012 16:38:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2012 16:38:48 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jlewis@silverhawk.net designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2012 16:38:40 +0000 Received: by iaeo4 with SMTP id o4so9132147iae.18 for ; Mon, 16 Jan 2012 08:38:19 -0800 (PST) Received: by 10.50.219.225 with SMTP id pr1mr10844352igc.21.1326731899428; Mon, 16 Jan 2012 08:38:19 -0800 (PST) Received: from cyanide.overstock.com ([65.116.116.6]) by mx.google.com with ESMTPS id b20sm67155380ibj.7.2012.01.16.08.38.18 (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 08:38:18 -0800 (PST) Sender: Joe Lewis Message-ID: <4F14526B.7030709@joe-lewis.com> Date: Mon, 16 Jan 2012 09:38:03 -0700 From: Joe Lewis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: Input Filters -- not seeing anything References: <01cb01ccd227$12a65570$37f30050$@com> <006201ccd469$995d87c0$cc189740$@com> <00ba01ccd46d$15c77a20$41566e60$@com> In-Reply-To: <00ba01ccd46d$15c77a20$41566e60$@com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I think he meant on your include line : #include "apr_buckets.h" #include "util_filter.h stat On 01/16/2012 09:37 AM, Pranesh Vadhirajan wrote: > I believe it's a header that is included in the Apache build, so I would > think it doesn't have that issue. > > Thanks, > Pranesh > > -----Original Message----- > From: Arturo 'Buanzo' Busleiman [mailto:buanzo@buanzo.com.ar] > Sent: Monday, January 16, 2012 11:18 AM > To: modules-dev@httpd.apache.org > Subject: Re: Input Filters -- not seeing anything > > Is util_filter.h lacking a closing " in the #include ? > > > On 1/16/12, Pranesh Vadhirajan wrote: >> Hello, >> >> I'm very new to developing Input Filters with Apache. I have written an >> input filter to read the request body content and print it to my error > log. >> I have two print statements in my filtering function (one to let me know >> that my filter code has been called and the other to print the request >> content). Yet, I'm not seeing anything happening (nothing is getting >> printed to my log). I have tried different things but I'm not able to > make >> anything work, so I've attached the code below hoping to get some insight > on >> why my filter doesn't seem to work. I am building the module using apxs > and >> I have a LoadModule directive in the httpd.conf file to load my module. > I'm >> new to the filter API and I'm totally out of ideas at this point as to why >> this is not working. >> >> >> #include "httpd.h" >> #include "http_core.h" >> #include "http_protocol.h" >> #include "http_config.h" >> #include "http_protocol.h" >> #include "http_main.h" >> #include "http_log.h" >> #include "http_request.h" >> #include "util_script.h" >> #include "http_connection.h" >> #include >> #include >> #include >> #include >> #include >> #include >> #include "uvds_metrics_sessions.h" >> >> #include "apr.h" >> #include "apr_lib.h" >> #include "apr_general.h" >> #include "apr_strings.h" >> #include "ap_config.h" >> #include "apr_buckets.h" >> #include "util_filter.h >> >> static apr_status_t req_body_filter_in(ap_filter_t *f, apr_bucket_brigade >> *b, ap_input_mode_t mode, apr_size_t *readbytes) >> { >> const char *str; >> int length; >> apr_bucket *e; >> >> fprintf(stderr,"reached this point\n"); >> >> ap_get_brigade(f->next, b, mode, APR_BLOCK_READ,1); >> >> e = APR_BRIGADE_FIRST(b); >> >> if (e->type == NULL) { >> return APR_SUCCESS; >> } >> >> apr_bucket_read(e,&str, (apr_size_t*)&length, APR_NONBLOCK_READ); >> fprintf(stderr,"req body: %s\n",str); >> >> return APR_SUCCESS; >> } >> >> static void my_register_hooks (apr_pool_t *p) { >> ap_hook_insert_filter(req_body_filter_in, NULL , NULL , >> APR_HOOK_MIDDLE) ; >> //ap_register_input_filter("get_request_body" , req_body_filter_in > , >> NULL , AP_FTYPE_RESOURCE) ; >> >> } >> >> module AP_MODULE_DECLARE_DATA my_module = >> { >> STANDARD20_MODULE_STUFF, >> NULL, /* Per-Directory >> Configuration */ >> NULL, /* Directory > Config >> Merger */ >> NULL, /* Per-Server >> Configuration */ >> NULL, /* Server Config >> Merger */ >> NULL, /* Command Table >> (Directives) */ >> my_register_hooks /* > Registering >> Hooks */ >> >> }; >> >>