Hi,

I have written a simple module but when I access the location all what I can see in the error_log is that "possible core dump in $APACHE_HOME.

This occures when I the last line in the dump_request_rec method., see below. Could somebody tell me why?

Thank you.

Best regards,
Graf László


/*
LoadModule xyl_module modules/mod_xyl.so
<Location /xyl>
    SetHandler xyl
</Location>
 */

#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "apr_time.h"

#define KILO_BYTES 1024

static void dump_request_rec(request_rec *r);

static int xyl_handler(request_rec *r) {
    if (strcmp(r->handler, "xyl")) {
        return DECLINED;
    }
    ap_set_content_type(r, "text/html; charset=ISO-8859-2");
    ap_rputs(DOCTYPE_XHTML_1_0T
            "<html xmlns=\"http://www.w3.org/1999/xhtml\";>\n"
            "<head>\n"
            "  <title>mod_xyl</title>\n" "</head>\n", r);
    ap_rputs("  <body>\n", r);
    dump_request_rec(r);
    ap_rputs("  </body>\n", r);
    ap_rputs("</html>\n", r);
    return OK;
}

static void xyl_register_hooks(apr_pool_t *p) {
    ap_hook_handler(xyl_handler, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA xyl_module = {
    STANDARD20_MODULE_STUFF,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    xyl_register_hooks
};

static void dump_request_rec(request_rec *r) {
    ap_rputs("  <strong>got a poolaaa</strong>\n", r);
    char *datestring = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
    apr_rfc822_date(datestring, apr_time_now());
    char *buff = apr_palloc(r->pool, KILO_BYTES);
    buff = apr_psprintf(r->pool, "time now: %s\n", datestring, NULL);
    ap_rputs(buff, r);
}

Reply via email to