nik600 | 15 Aug 2012 10:49
Picon

problem with ap_md5 in custom module

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)


Gmane