Revision: 1098
Author: phrakt
Date: Tue May 11 20:36:55 2010
Log: use http_entity_getsize() to access an entity's size
http://code.google.com/p/canopy-httpd/source/detail?r=1098
Modified:
/trunk/src/modules/mod_cgi/mod_cgi.c
/trunk/src/modules/mod_log_apache/mod_log_apache.c
=======================================
--- /trunk/src/modules/mod_cgi/mod_cgi.c Mon Aug 31 19:45:42 2009
+++ /trunk/src/modules/mod_cgi/mod_cgi.c Tue May 11 20:36:55 2010
@@ -153,6 +153,7 @@
{
int port;
char addrbuf[64];
+ uint64_t size = 0;
http_uri_t *uri = req->msg_req.req_url;
http_sockaddr_t addr;
@@ -209,8 +210,8 @@
/* content-related variables */
if (req->msg_entity != NULL) {
- mod_cgi_setenv("CONTENT_LENGTH", "%llu",
- (unsigned long long)req->msg_entity->ent_size);
+ http_entity_getsize(req->msg_entity, &size);
+ mod_cgi_setenv("CONTENT_LENGTH", "%llu", size);
mod_cgi_setenv("CONTENT_TYPE", req->msg_entity->ent_media);
}
=======================================
--- /trunk/src/modules/mod_log_apache/mod_log_apache.c Mon Aug 31 19:45:42
2009
+++ /trunk/src/modules/mod_log_apache/mod_log_apache.c Tue May 11 20:36:55
2010
@@ -143,6 +143,7 @@
{
size_t ret;
long gmthroff;
+ uint64_t size = 0;
char sign, buf[64], *fp;
cnp_buf_t *linebuf;
const char *sp;
@@ -163,8 +164,8 @@
switch (*fp) {
case 'B':
case 'b':
- cnp_buf_fappend(linebuf, "%u",
- resp->msg_entity->ent_size);
+ http_entity_getsize(resp->msg_entity, &size);
+ cnp_buf_fappend(linebuf, "%u", size);
break;
case 'h':
@@ -254,7 +255,7 @@
char buf[1024], datebuf[32];
char *sp, *level;
- if (ctime_r(&msg->msg_time.tv_sec, datebuf) == NULL)
+ if (ctime_r((time_t *)&msg->msg_time.tv_sec, datebuf) == NULL)
return;
if ((sp = strrchr(datebuf, '\n')) != NULL)
--
You received this message because you are subscribed to the Google Groups "Canopy Web Server Source Changes" group.
To post to this group, send email to
canopy-s...@googlegroups.com.
To unsubscribe from this group, send email to
canopy-srcchan...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/canopy-srcchanges?hl=en.