problem with ap_md5 in custom module

2012-08-15 Thread nik600
eturns 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

Re: problem with ap_md5 in custom module

2012-08-16 Thread nik600
Great! this fix the problem thanks for your help. On Wed, Aug 15, 2012 at 10:47 PM, Ben Noordhuis wrote: > On Wed, Aug 15, 2012 at 5:13 PM, nik600 wrote: >> Dear all >> >> i'm having a problem with ap_md5, i just want to write a custom module >> that compute c

forward request with proxy_http in custom module

2012-08-17 Thread nik600
. proxy and proxy_http are enabled and correctly working. Is this code correct to forward a request and make my module working as a proxy_http ? Thanks in advance -- /*/ nik600

Re: forward request with proxy_http in custom module

2012-08-17 Thread nik600
Ok, it wasn't clear to me to return DECLINED to look for other handlers, and also wasn't clear the possibility to specify an order. Now it works, thanks. On Fri, Aug 17, 2012 at 4:42 PM, Sorin Manolache wrote: > On 2012-08-17 16:25, nik600 wrote: >> >> Dear all >>

Re: best way to return the content of a file

2012-08-18 Thread nik600
? Thanks On Sat, Aug 18, 2012 at 12:33 PM, Nick Kew wrote: > > On 18 Aug 2012, at 09:51, nik600 wrote: > >> Is better: >> >> - to read the file and then send is using ap_rprintf > > Bad. > >> - to use apr_bucket_* > > Acceptable. > >> -

Re: best way to return the content of a file

2012-08-18 Thread nik600
h an initial check: if (!r->handler || strcmp(r->handler, "kcache")) return (DECLINED); but r->handler is null if the hook is called in ap_hook_translate_name state, so how can i check this condition? Thanks -- /*/ nik600 http://www.kumbe.it

Re: best way to return the content of a file

2012-08-18 Thread nik600
RK, APLOG_DEBUG,s,r,"KcachePath = %s",config.path); if(!config.enabled){ ap_log_rerror(APLOG_MARK, APLOG_NOTICE,s,r,"KcacheEnabled = Off, exiting from kcache"); return DECLINED; } ... ... but looking at logs it seems that KcacheEnabled is always On. Is my approach correct? Thanks -- /*/ nik600 http://www.kumbe.it

Re: best way to return the content of a file

2012-08-19 Thread nik600
On Sat, Aug 18, 2012 at 7:18 PM, nik600 wrote: > On Sat, Aug 18, 2012 at 6:32 PM, Eric Covener wrote: >>> i'm enabling my module with a Location directive: >>> >>> >>> SetHandler kcache >>> >>> >>> and i want t

strange behaviour using mod_proxy when the r->filename partially overlaps the requested uri

2012-08-21 Thread nik600
erver"; return DECLINED; } static void register_hooks(apr_pool_t* pool) { static const char *succ[] = {"mod_proxy.c","mod_alias.c","mod_userdir.c", NULL}; ap_hook_translate_name(kcache_handler_translate, NULL, succ, APR_HOOK_MIDDLE); } /***/ -- /*/ nik600 http://www.kumbe.it

Re: strange behaviour using mod_proxy when the r->filename partially overlaps the requested uri

2012-08-21 Thread nik600
2012/8/21 Sorin Manolache : > On 2012-08-21 13:39, nik600 wrote: > > Replace with > > apr_pcalloc(r->pool, strlen(newurl) + 1); > > in order to allocate space for the closing '\0'. > > Oh, i'm stupid...thanks -- /*/ nik600 http://www.kumbe.it

problem with shared memory and directives for httpd

2014-12-04 Thread nik600
od_kcache.c(96): [client 127.0.0.1] config->s->counter=69 >>[Thu Dec 04 15:24:48 2014] [debug] src/mod_kcache.c(96): [client 127.0.0.1] config->s->counter=70 ... i've attached the full example (100 lines of code) I'll appreciate any help, thank all in advance -- /*

Re: problem with shared memory and directives for httpd

2014-12-04 Thread nik600
hich sounds like it could be causing your problem. > > -Eric > > > From: nik600 [mailto:nik...@gmail.com] > Sent: Thursday, December 04, 2014 10:05 AM > To: modules-dev@httpd.apache.org > Subject: problem with shared memory and directives for httpd > > Dear all > &

Re: problem with shared memory and directives for httpd

2014-12-04 Thread nik600
gt; Okay but why are you managing the kcache_config structure with both the > per-directory AND the server-level functions? You should decide if your > kcache_config is server-wide or if it is per-directory, and use only the > appropriate functions. > -Eric > > > From: nik600 [ma

Re: problem with shared memory and directives for httpd

2014-12-04 Thread nik600
n test compile the chages, just a POC... > -- /*/ nik600 http://www.kumbe.it

Re: problem with shared memory and directives for httpd

2014-12-04 Thread nik600
yes, now it works, thanks again! 2014-12-04 23:49 GMT+01:00 nik600 : > Thanks a lot! > > i've understand the logic... i'll try and let you know! > > 2014-12-04 23:43 GMT+01:00 Yann Ylavic : > >> On Thu, Dec 4, 2014 at 10:52 PM, Yann Ylavic >> wrote: >&

is ap_hook_log_transaction the wright place where to write my stats code ?

2014-12-06 Thread nik600
t? Is there any other hook more appropriate to do that? Thanks all in advance. Bye -- /*/ nik600 http://www.kumbe.it

Re: is ap_hook_log_transaction the wright place where to write my stats code ?

2014-12-07 Thread nik600
Thanka for your reply! Is not so simple...the custom logic is a mixture of regex, memcached get, json, cookies and http headers so i had to write a custom module. Btw, thanks for your help! Il 07/dic/2014 10:25 "Sorin Manolache" ha scritto: > On 2014-12-07 01:36, nik600 wrote: