You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2004/12/06 22:43:48 UTC
svn commit: r110038 - /lenya/sandbox/mod_lenya/mod_lenya.c
Author: michi
Date: Mon Dec 6 13:43:47 2004
New Revision: 110038
URL: http://svn.apache.org/viewcvs?view=rev&rev=110038
Log:
debugging improved
Modified:
lenya/sandbox/mod_lenya/mod_lenya.c
Modified: lenya/sandbox/mod_lenya/mod_lenya.c
Url: http://svn.apache.org/viewcvs/lenya/sandbox/mod_lenya/mod_lenya.c?view=diff&rev=110038&p1=lenya/sandbox/mod_lenya/mod_lenya.c&r1=110037&p2=lenya/sandbox/mod_lenya/mod_lenya.c&r2=110038
==============================================================================
--- lenya/sandbox/mod_lenya/mod_lenya.c (original)
+++ lenya/sandbox/mod_lenya/mod_lenya.c Mon Dec 6 13:43:47 2004
@@ -114,9 +114,10 @@
/* check if the reuest is for DirectoryIndex */
if (curi[1] == 0) {
path = apr_palloc(r->pool, cfg->prefix_slen + cfg->dirindex_slen + 1 + 1);
+
sprintf(path, "%s/%s", cfg->cachedir, cfg->dirindex);
- DEBUG("dirindex lookup: %s\n",path);
+ DEBUG("DEBUG: dirindex lookup: %s\n",path);
} else {
curi = &curi[cfg->prefix_slen];
@@ -138,16 +139,19 @@
DEBUG("lookup: %s\n",path);
}
-
+
ret = apr_stat(&fi, path, APR_FINFO_SIZE , r->pool);
if (ret != APR_SUCCESS) {
- DEBUG("COULD NOT stat file\n");
+ DEBUG("DEBUG: COULD NOT stat file\n");
return DECLINED;
}
+
+ DEBUG("DEBUG: Reading from cache: %s\n", path);
ret = apr_file_open(&fl, path, APR_READ, 0, r->pool);
+
if (ret != APR_SUCCESS) {
- DEBUG("COULD NOT open file\n");
+ DEBUG("DEBUG: COULD NOT open file\n");
return DECLINED;
}
@@ -155,14 +159,13 @@
ap_set_content_type(r, "text/html");
if (ap_send_fd(fl, r, 0, (apr_size_t)fi.size, &sb) != APR_SUCCESS) {
- DEBUG("%i bytesd sent\n",sb);
+ DEBUG("DEBUG: %i bytesd sent\n",sb);
return DECLINED;
}
apr_file_close(fl);
-
- DEBUG("CACHED!!!!\n");
-
+
+ DEBUG("DEBUG: Sucessfully read from cache\n");
if (cfg->logging)
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org