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 86B96D2F3 for ; Wed, 15 Aug 2012 15:14:13 +0000 (UTC) Received: (qmail 9470 invoked by uid 500); 15 Aug 2012 15:14:13 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 9403 invoked by uid 500); 15 Aug 2012 15:14:12 -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 9395 invoked by uid 99); 15 Aug 2012 15:14:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2012 15:14:12 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nik600@gmail.com designates 209.85.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vc0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2012 15:14:06 +0000 Received: by vcbgb23 with SMTP id gb23so2038344vcb.18 for ; Wed, 15 Aug 2012 08:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nnLtUg7z8McWd9bkwhPTPNGNyXaFtrbm1aacD/uvT3U=; b=qeEX4cChho9RgnCFo2EPV7SOe64QSVyc7//6d9tOAmtoaD83EgUJX7ZpghRAYYP8H4 S4WLMClYFoqOxI0Iu0+WcVfTSSllbU4Vxu0o6HhI9DRwAtqnY3ZtY50Dhc45waNcw5I0 i7vQ3kx06xbt1W31mv7WTG8gQAN5AJdO0HtAhGATs1dvbUN6mIgHZxxNNDbYzeTlXfx/ kLTma7XQLxBldBtlG9xJ7T9/qVkGV6Zja9y/hBKh1TWCnF6dUPmIjisTzEdVl476TnBJ cjhZSC3uRwotfMVcJ0ZiBeaNHTfSuopT35HGm6f7aDuBj95HpjMk8BzEr9aInrTyrYcW Jbzw== MIME-Version: 1.0 Received: by 10.220.218.133 with SMTP id hq5mr12977840vcb.60.1345043625448; Wed, 15 Aug 2012 08:13:45 -0700 (PDT) Received: by 10.58.170.4 with HTTP; Wed, 15 Aug 2012 08:13:45 -0700 (PDT) Date: Wed, 15 Aug 2012 17:13:45 +0200 Message-ID: Subject: problem with ap_md5 in custom module From: nik600 To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Dear all i'm having a problem with ap_md5, i just want to write a custom module that compute che md5 checksum of the requested url and give it back to the user. This is my code: ***************************************************************** ***************************************************************** static int kcache_handler(request_rec* r) { if (!r->handler || strcmp(r->handler, "kcache")) return DECLINED; if (r->method_number != M_GET) return HTTP_METHOD_NOT_ALLOWED; char* kcache_md5; kcache_md5 = (char *)ap_md5(r->pool,r->unparsed_uri); ap_set_content_type(r, "text/html;charset=ascii"); ap_rputs("", r); ap_rputs("K-Hello World!", r); ap_rprintf(r,"

K-Hello World!

%s=%s

", r->unparsed_uri,kcache_md5); return OK; } ***************************************************************** ***************************************************************** i've got a warning during compilation: src/mod_kcache.c:18:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Is quite strange to me that ap_md5 returns an int, as in the documentation it is reported to return a char * http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__MD5.html By the way, if i try to run it i get a segfault, if i comment the line that prints kcache_md5 with ap_rprintf the module doesn't segfault. So, where i'm wrong? Thanks to all in advance -- /*************/ nik600