15 Aug 2012 10:49
problem with ap_md5 in custom module
nik600 <nik600 <at> gmail.com>
2012-08-15 08:49:40 GMT
2012-08-15 08:49:40 GMT
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("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">", r);
ap_rputs("<html><head><title>K-Hello World!</title></head>", r);
ap_rprintf(r,"<body><h1>K-Hello
World!</h1><p>%s=%s</p></body></html>", r->unparsed_uri,kcache_md5);
return OK;
}
*****************************************************************
*****************************************************************
(Continue reading)
RSS Feed