Revision: 14351 Author: adrian.chadd Date: Mon Nov 2 05:56:52 2009 Log: Flesh out the "alternative" HttpReplyClone() routine body which avoids calling the normal code path. This avoids extra calls to gmtime() via httpHeaderGetTime(); which is expensive under FreeBSD. I'm not sure why.
http://code.google.com/p/lusca-cache/source/detail?r=14351 Modified: /branches/LUSCA_HEAD/src/HttpReply.c ======================================= --- /branches/LUSCA_HEAD/src/HttpReply.c Mon Jun 29 09:26:34 2009 +++ /branches/LUSCA_HEAD/src/HttpReply.c Mon Nov 2 05:56:52 2009 @@ -390,26 +390,10 @@ { HttpReply *dst = httpReplyCreate(); - /* - * basic variables - */ dst->hdr_sz = src->hdr_sz; - - /* - * parser state - */ dst->pstate = src->pstate; - /* - * status line - */ dst->sline = src->sline; - /* - * header - */ httpHeaderAppend(&dst->header, &src->header); - /* - * body, if applicable - */ if (dst->body.mb.buf != NULL) memBufAppend(&dst->body.mb, dst->body.mb.buf, dst->body.mb.size); @@ -418,14 +402,21 @@ * when we've already -done- that, but I'll worry about doing it * faster later. Besides, there's too much other code to fix up. */ +#if 1 httpReplyHdrCacheInit(dst); -#if 0 +#else dst->content_length = src->content_length; dst->date = src->date; dst->last_modified = src->last_modified; + if (strIsNull(src->content_type)) + dst->content_type = StringNull; + else + dst->content_type = stringDup(&src->content_type); dst->expires = src->expires; dst->cache_control = httpHeaderGetCc(&dst->header); dst->content_range = httpHeaderGetContRange(&dst->header); + dst->keep_alive = src->keep_alive; + dst->expires = src->expires; #endif return dst; --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en -~----------~----~----~----~------~----~------~--~---
