From: Gonzalo A. <ga...@us...> - 2006-09-13 13:57:14
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv777/src Modified Files: Common.cpp Container.cpp DefaultSessionDriver.cpp DefaultSessionIDDriver.cpp Dictionary.cpp DiskSessionDriver.cpp EHTMLApplication.cpp Input.cpp Label.cpp MemBuf.cpp Page.cpp PageWriter.cpp Request.cpp Response.cpp Session.cpp StyleAttribute.cpp TagRenderer.cpp Log Message: * Added profiling calls. Index: Label.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Label.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Label.cpp 23 Aug 2006 10:32:57 -0000 1.7 --- Label.cpp 13 Sep 2006 13:57:06 -0000 1.8 *************** *** 20,23 **** --- 20,24 ---- #include <Label.h> + #include "Profiling.h" using namespace std; *************** *** 52,55 **** --- 53,57 ---- void Label::Render( PageWriter* Writer ) { + ProfileMe(); TagHandler.RenderBeginTag( Writer ); if ( TagHandler.GetHasContents() ) Index: Dictionary.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Dictionary.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Dictionary.cpp 12 Sep 2006 14:50:04 -0000 1.3 --- Dictionary.cpp 13 Sep 2006 13:57:06 -0000 1.4 *************** *** 2,5 **** --- 2,6 ---- #include "Dictionary.h" #include "Common.h" + #include "Profiling.h" #include <sstream> *************** *** 18,21 **** --- 19,23 ---- string Dictionary::Serialize() { + ProfileMe(); string str; for (Dictionary::iterator i = begin(); i != end(); ++i) { *************** *** 28,31 **** --- 30,34 ---- ostream& operator << (ostream& o, Dictionary& d) { + ProfileMe(); for (Dictionary::iterator i = d.begin(); i != d.end(); ++i) o << urlencode(i->first) << " " *************** *** 35,38 **** --- 38,42 ---- bool Dictionary::Marshall(const string& s) { + ProfileMe(); size_type i = 0; size_type ii = 0; *************** *** 54,57 **** --- 58,62 ---- istream& operator >> (istream& i, Dictionary& d) { + ProfileMe(); char line[512]; while (!i.getline(line,sizeof(line)-1).eof()) { Index: Page.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Page.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Page.cpp 23 Aug 2006 10:32:57 -0000 1.10 --- Page.cpp 13 Sep 2006 13:57:07 -0000 1.11 *************** *** 23,26 **** --- 23,27 ---- #include <stdlib.h> #include <Page.h> + #include "Profiling.h" using namespace std; *************** *** 35,38 **** --- 36,40 ---- void Page::Render( PageWriter* Writer ) { + ProfileMe(); // Set the content type __request_context * rc = Writer->GetRequestContext(); *************** *** 74,77 **** --- 76,80 ---- void Page::AddIntoHead( Component * Comp, int Pos ) { + ProfileMe(); if ( Pos < 0 ) HeadContents.push_back( Comp ); *************** *** 99,102 **** --- 102,106 ---- void Page::RemoveFromHead( Component * Comp ) { + ProfileMe(); ChildrenList::iterator itr = HeadContents.begin(); const ChildrenList::const_iterator & end = HeadContents.end(); *************** *** 119,122 **** --- 123,127 ---- void Page::ClearHead() { + ProfileMe(); HeadContents.clear(); HeadCount = 0; *************** *** 130,133 **** --- 135,139 ---- void Page::DoNameHeadChildren() { + ProfileMe(); ChildrenList::iterator itr = HeadContents.end(); const ChildrenList::const_iterator & begin = HeadContents.begin(); *************** *** 168,171 **** --- 174,178 ---- int Page::Compose() { + ProfileMe(); ChildrenList::iterator itr = HeadContents.end(); const ChildrenList::const_iterator & begin = HeadContents.begin(); Index: EHTMLApplication.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/EHTMLApplication.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EHTMLApplication.cpp 13 Sep 2006 12:48:11 -0000 1.12 --- EHTMLApplication.cpp 13 Sep 2006 13:57:06 -0000 1.13 *************** *** 33,36 **** --- 33,38 ---- #include "ehtml.h" + #include "Profiling.h" + using namespace std; *************** *** 38,41 **** --- 40,44 ---- : RequestContext( ReqContext ) { + ProfileMe(); /* The EHTML application will not work without the request context. */ ASSERT( ReqContext ); *************** *** 52,55 **** --- 55,59 ---- EHTMLApplication::~EHTMLApplication() { + ProfileMe(); // Do nothing actually... APR_DEALLOCATE( RequestContext, Request, Request ); *************** *** 59,62 **** --- 63,67 ---- int EHTMLApplication::Run() { + ProfileMe(); // Execute all stages int retVal = 0; *************** *** 82,85 **** --- 87,91 ---- void EHTMLApplication::SetPage( class Page * Page ) { + ProfileMe(); this->Page = Page; if ( Page ) *************** *** 89,92 **** --- 95,99 ---- int EHTMLApplication::DoReadStage() { + ProfileMe(); OnRead.Trigger(); return Request->Prepare(); *************** *** 95,98 **** --- 102,106 ---- int EHTMLApplication::DoInitStage() { + ProfileMe(); driver = SessionDriver::Selected(); if (driver != NULL) { *************** *** 126,129 **** --- 134,138 ---- int EHTMLApplication::DoComposeStage() { + ProfileMe(); OnCompose.Trigger(); if ( Page ) *************** *** 135,138 **** --- 144,148 ---- int EHTMLApplication::DoLoadStage() { + ProfileMe(); OnLoad.Trigger(); if ( Page ) *************** *** 144,147 **** --- 154,158 ---- int EHTMLApplication::DoRenderStage() { + ProfileMe(); OnRender.Trigger(); if ( Page ) *************** *** 155,158 **** --- 166,170 ---- int EHTMLApplication::DoFinishStage() { + ProfileMe(); OnFinish.Trigger(); *************** *** 186,189 **** --- 198,202 ---- void EHTMLApplication::ShutSessionsDown() { + ProfileMe(); SessionList::iterator iter = OpenSessions.begin(); const SessionList::const_iterator & end = OpenSessions.end(); *************** *** 201,204 **** --- 214,218 ---- void EHTMLApplication::ErrorCleanup() { + ProfileMe(); ShutSessionsDown(); } *************** *** 238,241 **** --- 252,256 ---- void EHTMLApplication::Log(int level, const char* fmt, va_list l) const { + ProfileMe(); char* msg = (char*)malloc(512); vsnprintf(msg, 511, fmt, l); Index: DefaultSessionIDDriver.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/DefaultSessionIDDriver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultSessionIDDriver.cpp 8 Sep 2006 14:30:59 -0000 1.1 --- DefaultSessionIDDriver.cpp 13 Sep 2006 13:57:06 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- #include "Session.h" #include "Common.h" + #include "Profiling.h" using namespace std; *************** *** 66,69 **** --- 67,71 ---- bool DefaultSessionIDDriver::SetArgs(const string& arg) { + ProfileMe(); bool dev = true; if (!strncmp(arg.c_str(), "extra_entropy=", 14)) *************** *** 77,80 **** --- 79,83 ---- bool DefaultSessionIDDriver::ValidID(SessionID& id) { + ProfileMe(); if (id.binary().Size() != 4*(1+extra_entropy)) return false; *************** *** 92,95 **** --- 95,99 ---- SessionID DefaultSessionIDDriver::GenerateID() { + ProfileMe(); static uint32_t seq = ehtml_random(); sesid_t* id = (sesid_t*)malloc(sizeof(sesid_t)); Index: DiskSessionDriver.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/DiskSessionDriver.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DiskSessionDriver.cpp 12 Sep 2006 15:23:33 -0000 1.3 --- DiskSessionDriver.cpp 13 Sep 2006 13:57:06 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- #include <Session.h> #include <Common.h> + #include "Profiling.h" #include <unistd.h> *************** *** 44,47 **** --- 45,49 ---- bool DiskSessionDriver::mayBeCollect() { + ProfileMe(); uint32_t i = random(); time_t now = time(NULL); *************** *** 73,76 **** --- 75,79 ---- bool DiskSessionDriver::SetArgs(const string& arg) { + ProfileMe(); //@TODO: should check that no session is open. istringstream i(arg.c_str()); *************** *** 98,101 **** --- 101,105 ---- bool DiskSessionDriver::Connect() { + ProfileMe(); if (connected) return false; *************** *** 104,107 **** --- 108,112 ---- bool DiskSessionDriver::Disconnect() { + ProfileMe(); if (connected) { connected = false; *************** *** 112,115 **** --- 117,121 ---- Session* DiskSessionDriver::Get(const SessionID& id) { + ProfileMe(); if (!connected) return NULL; *************** *** 150,153 **** --- 156,160 ---- bool DiskSessionDriver::Save(Session* s) { + ProfileMe(); if (!connected) return false; *************** *** 161,164 **** --- 168,172 ---- bool DiskSessionDriver::Remove(Session* s) { + ProfileMe(); if (!connected) return false; *************** *** 168,171 **** --- 176,180 ---- bool DiskSessionDriver::Release(Session* s) { + ProfileMe(); if (!connected) return false; Index: MemBuf.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/MemBuf.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MemBuf.cpp 8 Sep 2006 20:57:47 -0000 1.2 --- MemBuf.cpp 13 Sep 2006 13:57:07 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- #include "MemBuf.h" #include "Common.h" + #include "Profiling.h" #include <stdlib.h> *************** *** 7,14 **** --- 8,17 ---- MemBuf::Buf::~Buf() { + ProfileMe(); free(_buf); } MemBuf::~MemBuf() { + ProfileMe(); if (_b) { if (_b->_refcnt == 1) { *************** *** 21,24 **** --- 24,28 ---- void MemBuf::resize(size_t s) { + ProfileMe(); if (_b == NULL) { _b = new Buf(malloc(s),s); *************** *** 33,40 **** --- 37,46 ---- MemBuf MemBuf::Dup(const void* p, size_t l) { + ProfileMe(); return MemBuf(xmemdup(p,l),l); } MemBuf& MemBuf::operator = (const MemBuf& mb) { + ProfileMe(); if (_b) { if (_b->_refcnt == 1) { *************** *** 52,55 **** --- 58,62 ---- string MemBuf::AsString() throw (const char*) { + ProfileMe(); string dev(Char()); if (Size()-1 != dev.length()) Index: PageWriter.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/PageWriter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PageWriter.cpp 8 Sep 2006 14:34:46 -0000 1.7 --- PageWriter.cpp 13 Sep 2006 13:57:07 -0000 1.8 *************** *** 20,23 **** --- 20,24 ---- #include <PageWriter.h> + #include "Profiling.h" using namespace std; *************** *** 26,29 **** --- 27,31 ---- : Enc( Enc ) { + ProfileMe(); RequestContext = rc; } *************** *** 31,34 **** --- 33,37 ---- PageWriter& PageWriter::operator << ( const char * str ) { + ProfileMe(); ap_rputs( str, RequestContext->r ); return *this; *************** *** 37,40 **** --- 40,44 ---- PageWriter& PageWriter::operator << ( const string& str ) { + ProfileMe(); ap_rwrite( str.c_str(), str.length(), RequestContext->r ); return * this; *************** *** 48,51 **** --- 52,56 ---- PageWriter& PageWriter::operator << ( int num ) { + ProfileMe(); ap_rprintf( RequestContext->r, "%d", num ); return *this; *************** *** 54,57 **** --- 59,63 ---- PageWriter& PageWriter::operator << ( char c ) { + ProfileMe(); ap_rputc( c, RequestContext->r ); return *this; *************** *** 60,63 **** --- 66,70 ---- PageWriter& PageWriter::operator << ( const wchar_t * str ) { + ProfileMe(); char buf[256]; register int i = 0; Index: Input.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Input.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Input.cpp 23 Aug 2006 10:32:57 -0000 1.8 --- Input.cpp 13 Sep 2006 13:57:06 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- #include <Input.h> #include <Page.h> + #include "Profiling.h" using namespace std; *************** *** 32,35 **** --- 33,37 ---- void Input::SetType( InputType Type ) { + ProfileMe(); this->Type = Type; switch( Type ) *************** *** 160,163 **** --- 162,166 ---- int Input::Load() { + ProfileMe(); if ( IsValuePersistent ) { Index: StyleAttribute.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/StyleAttribute.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StyleAttribute.cpp 28 Feb 2006 19:58:11 -0000 1.5 --- StyleAttribute.cpp 13 Sep 2006 13:57:07 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- #include <StyleAttribute.h> #include <sstream> + #include "Profiling.h" using namespace std; *************** *** 46,49 **** --- 47,51 ---- void StyleAttribute::SetValue( const string & Value ) { + ProfileMe(); if ( StyleCounter ) { // Clear the buffer... *************** *** 61,64 **** --- 63,67 ---- void StyleAttribute::SetValue( const char * Value ) { + ProfileMe(); if ( StyleCounter ) { // Clear the buffer... *************** *** 76,79 **** --- 79,83 ---- const string & StyleAttribute::GetValue() const { + ProfileMe(); if ( InBuffer ) // Is there anything stored in the map? { *************** *** 108,111 **** --- 112,116 ---- void StyleAttribute::Render( PageWriter * Writer ) { + ProfileMe(); if ( InBuffer ) // Is the value in the buffer? { // Write from the buffer *************** *** 133,136 **** --- 138,142 ---- void StyleAttribute::AddStyle( const string & StyleName, const string & Value ) { + ProfileMe(); pair< string, string > _tmpPair; _tmpPair.first = StyleName; *************** *** 145,148 **** --- 151,155 ---- void StyleAttribute::AddStyle( const char * StyleName, const char * Value ) { + ProfileMe(); pair< string, string > _tmpPair; _tmpPair.first = StyleName; *************** *** 158,161 **** --- 165,169 ---- void StyleAttribute::RemoveStyle( const string & StyleName ) { + ProfileMe(); int erased = StyleData.erase( StyleName ); // Has anything been erased? Index: Common.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Common.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Common.cpp 11 Sep 2006 23:17:06 -0000 1.9 --- Common.cpp 13 Sep 2006 13:57:06 -0000 1.10 *************** *** 20,23 **** --- 20,24 ---- #include "Common.h" + #include "Profiling.h" #include <stdlib.h> #include <sstream> *************** *** 37,40 **** --- 38,42 ---- static inline const char * __DecodeURIEscapeCode( const char * Loc, char & Decoded ) { + ProfileMe(); register char a = *(Loc++); register char b = *Loc; *************** *** 64,67 **** --- 66,70 ---- int ParseURLEncodedArgs( const char * Str, KeyValueMap& Map ) { + ProfileMe(); int retVal = 0; *************** *** 178,181 **** --- 181,185 ---- static inline unsigned short GetHexFromByte( unsigned char num ) { + ProfileMe(); register char a = ( 0xf0 & num ) >> 4; register char b = 0x0f & num; *************** *** 195,198 **** --- 199,203 ---- static inline unsigned char hex_aton(char a) { + ProfileMe(); unsigned char c = 0xff; *************** *** 209,212 **** --- 214,218 ---- static inline unsigned char GetByteFromHex( char a, char b ) { + ProfileMe(); return (hex_aton(a) << 4) | hex_aton(b); } *************** *** 214,217 **** --- 220,224 ---- int GetStringFromByte( char * buf, int buf_len, const unsigned char * binary_array, int arr_len ) { + ProfileMe(); // Sanity check if ( buf && binary_array && arr_len > 0 && buf_len >= (arr_len << 1) ) *************** *** 236,239 **** --- 243,247 ---- int GetByteFromString( unsigned char * buf, int buf_len, const char * hex_string ) { + ProfileMe(); if ( buf && hex_string ) { *************** *** 255,258 **** --- 263,267 ---- const char* ehtml_strerror(int errno) { + ProfileMe(); if (errno >= 0) return strerror(errno); *************** *** 273,280 **** --- 282,291 ---- string urlencode(const string& s) { //@todo better way to fix this const issue? + ProfileMe(); return urlencode(MemBuf::Dup((void*)s.c_str(), s.length())); } string urlencode(const MemBuf& mb) { + ProfileMe(); size_t n_escape = 0; const char* s = mb.Char(); *************** *** 306,309 **** --- 317,321 ---- MemBuf urldecode(const string& s) throw (const char*) { //@todo test + ProfileMe(); MemBuf dev(strdup(s.c_str()), s.length()+1); char* obuf = dev.Char(); *************** *** 323,330 **** --- 335,344 ---- string hexencode(const std::string& s) { + ProfileMe(); return hexencode(MemBuf::Dup(s.c_str(), s.length())); } string hexencode(const MemBuf& mb) { + ProfileMe(); string dev; dev.reserve(mb.Size()*2+1); *************** *** 340,343 **** --- 354,358 ---- MemBuf hexdecode(const string& s) throw (const char*) { + ProfileMe(); MemBuf dev; dev.resize(s.length()/2); *************** *** 357,364 **** --- 372,381 ---- std::string base64encode(const std::string& s) { //@todo test + ProfileMe(); return base64encode(MemBuf::Dup(s.c_str(),s.length())); } std::string base64encode(const MemBuf& mb) { //@todo test + ProfileMe(); string dev; dev.reserve(mb.Size() * 4 / 3 + 2); *************** *** 409,412 **** --- 426,430 ---- unsigned char _b64_aton(char c) { + ProfileMe(); if (c >= 'A' && c <= 'Z') return int(c-'A'); if (c >= 'a' && c <= 'z') return int(c-'a') + ('Z'-'A') + 1; *************** *** 419,422 **** --- 437,441 ---- MemBuf base64decode(const std::string& s) throw (const char*) { //@todo test + ProfileMe(); // 0000 0011 | 1111 2222 | 2233 3333 MemBuf dev; *************** *** 443,446 **** --- 462,466 ---- unsigned long xatoul(const char* s) throw (const char*) { //@todo test + ProfileMe(); char* end; if (!s || !s[0]) *************** *** 453,456 **** --- 473,477 ---- double xatod(const char* s) throw (const char*) { //@todo test + ProfileMe(); char* end; if (!s || !s[0]) *************** *** 463,466 **** --- 484,488 ---- bool is_directory(const char* name) { + ProfileMe(); struct stat st; return stat(name, &st) == 0 && S_ISDIR(st.st_mode); *************** *** 468,471 **** --- 490,494 ---- void* xmemdup(const void* p, size_t n) { + ProfileMe(); void* dev = malloc(n); assert(dev != NULL); *************** *** 474,477 **** --- 497,501 ---- const char* skip_ws(const char* s) { + ProfileMe(); while (isspace(*s)) ++s; return s; *************** *** 479,482 **** --- 503,507 ---- char* skip_ws(char* s) { + ProfileMe(); while (isspace(*s)) ++s; return s; *************** *** 484,487 **** --- 509,513 ---- const char* skip_word(const char* s) { + ProfileMe(); while (!isspace(*s) && *s) ++s; return s; *************** *** 489,492 **** --- 515,519 ---- char* skip_word(char* s) { + ProfileMe(); while (!isspace(*s) && *s) ++s; return s; Index: Request.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Request.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Request.cpp 12 Sep 2006 15:23:33 -0000 1.8 --- Request.cpp 13 Sep 2006 13:57:07 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- #include <Request.h> #include <apr_tables.h> + #include "Profiling.h" using namespace std; *************** *** 49,52 **** --- 50,54 ---- int Request::ParseQuery() { + ProfileMe(); request_rec * r = RequestContext->r; *************** *** 107,110 **** --- 109,113 ---- const string * Request::GetArgument( const string & Key ) const { + ProfileMe(); // Try to find the key KeyValueMap::const_iterator _itr = Arguments.find( Key ); *************** *** 118,121 **** --- 121,125 ---- void Request::Error(const char* fmt, ...) const { + ProfileMe(); if (Application == NULL) return; *************** *** 127,130 **** --- 131,135 ---- void Request::Debug(const char* fmt, ...) const { + ProfileMe(); if (Application == NULL) return; *************** *** 137,140 **** --- 142,146 ---- const string * Request::operator []( const string & Key ) const { + ProfileMe(); // Try to find the key KeyValueMap::const_iterator _itr = Arguments.find( Key ); *************** *** 148,151 **** --- 154,158 ---- const string* Request::GetCookie(const string& name) const { + ProfileMe(); Debug("Looking for %s\n", name.c_str()); string s = name + "="; *************** *** 164,167 **** --- 171,175 ---- void Request::ParseHeader() { + ProfileMe(); const apr_array_header_t* arr = apr_table_elts( RequestContext->r->headers_in ); Debug("%s:%d\n", __PRETTY_FUNCTION__, __LINE__); Index: Session.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Session.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Session.cpp 12 Sep 2006 23:11:58 -0000 1.15 --- Session.cpp 13 Sep 2006 13:57:07 -0000 1.16 *************** *** 23,26 **** --- 23,27 ---- #include <Request.h> #include <dlfcn.h> + #include "Profiling.h" using namespace std; *************** *** 35,38 **** --- 36,40 ---- SessionID::SessionID() { + ProfileMe(); _binary_set = 0; _base64_set = 0; *************** *** 43,46 **** --- 45,49 ---- SessionID::SessionID(const SessionID& id): _binary(id._binary), _base64(id._base64), _hex(id._hex), _urlencoded(id._urlencoded) { + ProfileMe(); _binary_set = id._binary_set; _base64_set = id._base64_set; *************** *** 50,53 **** --- 53,57 ---- SessionID::SessionID(const MemBuf& mb): _binary(mb) { + ProfileMe(); _binary_set = 1; _base64_set = 0; *************** *** 57,60 **** --- 61,65 ---- SessionID::SessionID(void* b, size_t nbytes, bool dup): _binary(b,nbytes) { + ProfileMe(); if (dup) _binary = MemBuf::Dup(b,nbytes); *************** *** 69,72 **** --- 74,78 ---- MemBuf& SessionID::binary() throw (const char*) { + ProfileMe(); if (!_binary_set) throw "binary session id is not set"; *************** *** 75,78 **** --- 81,85 ---- const MemBuf& SessionID::binary() const throw (const char*) { + ProfileMe(); if (!_binary_set) throw "binary session id is not set"; *************** *** 81,84 **** --- 88,92 ---- bool SessionID::binary(MemBuf& mb) { + ProfileMe(); _binary = mb; _binary_set = 1; *************** *** 89,92 **** --- 97,101 ---- string& SessionID::base64() throw (const char*) { + ProfileMe(); if (!_base64_set) { _base64 = base64encode(MemBuf(binary().Buffer(), binary().Size())); *************** *** 97,100 **** --- 106,110 ---- const string& SessionID::base64() const throw (const char*) { + ProfileMe(); if (!_base64_set) { //@todo we could avoid memdup here.... *************** *** 106,109 **** --- 116,120 ---- bool SessionID::base64(string& s) { + ProfileMe(); _base64 = s; _binary = base64decode(s); *************** *** 114,117 **** --- 125,129 ---- string& SessionID::hex() throw (const char*) { + ProfileMe(); if (!_hex_set) { _hex = hexencode(MemBuf::Dup(binary().Buffer(), binary().Size())); *************** *** 122,125 **** --- 134,138 ---- const string& SessionID::hex() const throw (const char*) { + ProfileMe(); if (!_hex_set) { //@todo we could avoid memdup here.... *************** *** 131,134 **** --- 144,148 ---- bool SessionID::hex(string& s) { + ProfileMe(); _hex = s; _binary = hexdecode(s); *************** *** 139,142 **** --- 153,157 ---- string& SessionID::urlencoded() throw (const char*) { + ProfileMe(); if (!_url_set) { _urlencoded = urlencode(_binary); *************** *** 147,150 **** --- 162,166 ---- const string& SessionID::urlencoded() const throw (const char*) { + ProfileMe(); if (!_url_set) { _urlencoded = urlencode(_binary); *************** *** 155,158 **** --- 171,175 ---- bool SessionID::urlencoded(string& s) { + ProfileMe(); _urlencoded = s; _binary = urldecode(s); *************** *** 255,258 **** --- 272,276 ---- Session* SessionDriver::Get() { + ProfileMe(); assert(_app != NULL); Request* req = _app->GetRequest(); *************** *** 267,270 **** --- 285,289 ---- string Session::Serialize() { + ProfileMe(); char _e[11]; snprintf(_e, 11, "%lu", _expires); *************** *** 276,279 **** --- 295,299 ---- ostream& operator << (ostream& o, Session& s) { + ProfileMe(); char _e[11]; snprintf(_e, 11, "%lu", s.Expires()); *************** *** 285,288 **** --- 305,309 ---- bool Session::Marshall(const string& s) { + ProfileMe(); if (!Dictionary::Marshall(s)) return false; *************** *** 293,296 **** --- 314,318 ---- istream& operator >> (istream& i, Session& s) { + ProfileMe(); i >> *static_cast<Dictionary*>(&s); s.Expires(xatoul(s["$$__EXPIRES$$"].c_str())); *************** *** 302,305 **** --- 324,328 ---- //@TODO: would be nice to check selected is the same session driver which //created me.... + ProfileMe(); SessionDriver::Selected()->Release(this); } Index: TagRenderer.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/TagRenderer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TagRenderer.cpp 6 Mar 2006 08:00:36 -0000 1.6 --- TagRenderer.cpp 13 Sep 2006 13:57:07 -0000 1.7 *************** *** 22,25 **** --- 22,26 ---- #include <TagRenderer.h> #include <string.h> + #include "Profiling.h" using namespace std; *************** *** 40,43 **** --- 41,45 ---- TagAttribute * TagRenderer::AddAttribute( TagAttribute * Attribute ) { + ProfileMe(); // The pointers should not be null... ASSERT( Attribute ); *************** *** 60,63 **** --- 62,66 ---- void TagRenderer::RemoveAttribute( TagAttribute* Attribute ) { + ProfileMe(); // The pointer should not be null... ASSERT( Attribute ); *************** *** 74,77 **** --- 77,81 ---- TagAttribute* TagRenderer::GetAttribute( const string & Key ) const { + ProfileMe(); // The key must be non-null... ASSERT( Key ); *************** *** 93,96 **** --- 97,101 ---- void TagRenderer::RenderBeginTag( PageWriter* Writer ) { + ProfileMe(); // Write the tag's name out... *Writer << "<" << TagName; *************** *** 117,120 **** --- 122,126 ---- void TagRenderer::RenderEndTag( PageWriter* Writer ) { + ProfileMe(); if ( HasContents ) *Writer << "</" << TagName << ">"; Index: DefaultSessionDriver.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/DefaultSessionDriver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultSessionDriver.cpp 8 Sep 2006 14:30:59 -0000 1.1 --- DefaultSessionDriver.cpp 13 Sep 2006 13:57:06 -0000 1.2 *************** *** 25,32 **** --- 25,34 ---- #include "DefaultSessionDriver.h" + #include "Profiling.h" using namespace std; bool DefaultSessionDriver::SetArgs(const string& arg) { + ProfileMe(); istringstream s(arg); string opt; *************** *** 94,97 **** --- 96,100 ---- Session* DefaultSessionDriver::Get (const SessionID& id) { + ProfileMe(); // We are connected. Send the request and wait for the answer DSSGetData get_data; *************** *** 139,142 **** --- 142,146 ---- bool DefaultSessionDriver::Save(Session* s) { + ProfileMe(); // We are connected. Send the request and wait for the answer bool dev = true; *************** *** 191,194 **** --- 195,199 ---- bool DefaultSessionDriver::Remove (Session* s) { + ProfileMe(); // Send the request and wait for the answer DSSUnregisterID unreg; *************** *** 215,218 **** --- 220,224 ---- int DefaultSessionDriver::Socket() { + ProfileMe(); if (fd < 0) fd = socket(addr.protocol_family, SOCK_STREAM, 0); *************** *** 221,224 **** --- 227,231 ---- bool DefaultSessionDriver::Bind() { + ProfileMe(); return bind(Socket(), &addr.addr._addr, addr.addr_len) == 0 ? true : false; } *************** *** 226,229 **** --- 233,237 ---- bool DefaultSessionDriver::Connect() { + ProfileMe(); // Open a new connection to the server int fd = Socket(); *************** *** 236,239 **** --- 244,248 ---- bool DefaultSessionDriver::Disconnect() { + ProfileMe(); // Post a quit message and close the connection DSSStandard rec; Index: Response.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Response.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Response.cpp 12 Sep 2006 00:26:47 -0000 1.3 --- Response.cpp 13 Sep 2006 13:57:07 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- #include <Response.h> + #include "Profiling.h" using namespace std; *************** *** 29,32 **** --- 30,34 ---- void Response::SetCookie(const std::string& name, const std::string& value) { + ProfileMe(); string val(name + "=" + value + "; path=/"); apr_table_set(RequestContext->r->headers_out, Index: Container.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Container.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Container.cpp 23 Aug 2006 10:32:57 -0000 1.10 --- Container.cpp 13 Sep 2006 13:57:06 -0000 1.11 *************** *** 24,27 **** --- 24,29 ---- #include <sstream> + #include "Profiling.h" + using namespace std; *************** *** 33,36 **** --- 35,39 ---- void Container::Add( Component* comp, int pos ) { + ProfileMe(); if ( pos < 0 ) Children.push_back( comp ); *************** *** 58,61 **** --- 61,65 ---- void Container::DoNameChildren() { + ProfileMe(); ChildrenList::iterator itr = Children.end(); const ChildrenList::const_iterator & begin = Children.begin(); *************** *** 93,96 **** --- 97,101 ---- void Container::SetId( const string & Id ) { + ProfileMe(); Component::SetId( Id ); if ( AutoNaming ) *************** *** 100,103 **** --- 105,109 ---- void Container::SetId( const char * Id ) { + ProfileMe(); Component::SetId( Id ); if ( AutoNaming ) *************** *** 107,110 **** --- 113,117 ---- void Container::SetPage( Page* OwnerPage ) { + ProfileMe(); Component::SetPage( OwnerPage ); ChildrenList::iterator itr = Children.end(); *************** *** 116,119 **** --- 123,127 ---- void Container::SetParent( Container* Parent ) { + ProfileMe(); Component::SetParent( Parent ); ChildrenList::iterator itr = Children.end(); *************** *** 125,128 **** --- 133,137 ---- void Container::Clear() { + ProfileMe(); Children.clear(); ChildrenCount = 0; *************** *** 131,134 **** --- 140,144 ---- void Container::Remove( Component* comp ) { + ProfileMe(); ChildrenList::iterator itr = Children.begin(); const ChildrenList::const_iterator & end = Children.end(); *************** *** 156,159 **** --- 166,170 ---- void Container::Render( PageWriter* Writer ) { + ProfileMe(); TagHandler.RenderBeginTag( Writer ); ChildrenList::iterator itr = Children.end(); *************** *** 168,171 **** --- 179,183 ---- int Container::Load() { + ProfileMe(); ChildrenList::iterator itr = Children.end(); const ChildrenList::const_iterator & begin = Children.begin(); *************** *** 181,184 **** --- 193,197 ---- int Container::Compose() { + ProfileMe(); ChildrenList::iterator itr = Children.end(); const ChildrenList::const_iterator & begin = Children.begin(); |