From: Gonzalo A. <ga...@us...> - 2006-10-04 16:37:28
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22439/src Modified Files: EHTMLApplication.cpp Log Message: * Fixed initialization order in EHTMLApplication. * on error, HTTP_INTERNAL_SERVER_ERROR is returned. Otherwise, the ehtml shared object is returned. * Removed unnecesary va_copy calls. Index: EHTMLApplication.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/EHTMLApplication.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EHTMLApplication.cpp 21 Sep 2006 20:03:22 -0000 1.14 --- EHTMLApplication.cpp 4 Oct 2006 16:37:23 -0000 1.15 *************** *** 38,42 **** EHTMLApplication::EHTMLApplication( request_context * ReqContext ): ! RequestContext( ReqContext ), Request(NULL), Response(NULL), Page(NULL), driver(NULL), session(NULL) { --- 38,42 ---- EHTMLApplication::EHTMLApplication( request_context * ReqContext ): ! Request(NULL), Response(NULL), RequestContext(ReqContext), Page(NULL), driver(NULL), session(NULL) { *************** *** 83,87 **** error: ErrorCleanup(); ! return retVal; } --- 83,87 ---- error: ErrorCleanup(); ! return HTTP_INTERNAL_SERVER_ERROR; } *************** *** 171,175 **** if (session && driver) { ! Debug("Finish: session id=%s\n", session->ID().hex().c_str()); if (!driver->Save(session)) { Error("Error saving session (hex=%s): %s", --- 171,175 ---- if (session && driver) { ! Debug("Finish: session id=%s", session->ID().hex().c_str()); if (!driver->Save(session)) { Error("Error saving session (hex=%s): %s", *************** *** 227,231 **** void EHTMLApplication::Error(const char* fmt, va_list l) const { ! Log(APLOG_ERR, fmt, l); } --- 227,234 ---- void EHTMLApplication::Error(const char* fmt, va_list l) const { ! va_list l2; ! va_copy (l2, l); ! Log(APLOG_ERR, fmt, l2); ! va_end(l2); } *************** *** 254,263 **** void EHTMLApplication::Log(int level, const char* fmt, va_list l) const { ProfileMe(); ! char* msg = (char*)malloc(512); ! vsnprintf(msg, 511, fmt, l); ! msg[511] = '\0'; ap_log_error(APLOG_MARK, level, 0, RequestContext->r->server, "%s: %s", prefix(level), msg); free(msg); } --- 257,268 ---- void EHTMLApplication::Log(int level, const char* fmt, va_list l) const { ProfileMe(); ! char* msg = (char*)calloc(512,1); ! va_list l2; ! va_copy(l2, l); ! vsnprintf(msg, 511, fmt, l2); ap_log_error(APLOG_MARK, level, 0, RequestContext->r->server, "%s: %s", prefix(level), msg); + va_end(l2); free(msg); } |