You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(38) |
Sep
(134) |
Oct
(30) |
Nov
(8) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
(14) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gonzalo A. <ga...@us...> - 2006-09-12 15:23:36
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19761/include Modified Files: EHTMLApplication.h Request.h Session.h Log Message: * Removed spurius debugging messages. * Added a propper debugging framework. Index: EHTMLApplication.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/EHTMLApplication.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EHTMLApplication.h 3 Mar 2006 14:45:17 -0000 1.7 --- EHTMLApplication.h 12 Sep 2006 15:23:32 -0000 1.8 *************** *** 28,31 **** --- 28,33 ---- #include <list> + #include <stdarg.h> + class Response; class Request; *************** *** 214,217 **** --- 216,234 ---- Event OnFinish; + /** + * Error logging method. + */ + void Error(const char* fmt, ...) const __attribute__ ((format (printf, 2, 3))); + + /** + * Error logging method. + */ + void Error(const char* fmt, va_list l) const; + + /** + * Debug message logging method + */ + void Debug(const char* fmt, ...) const __attribute__ ((format (printf, 2, 3))); + protected: friend class Session; *************** *** 244,247 **** --- 261,269 ---- */ SessionList OpenSessions; + + /** + * Message logging + */ + void Log(int level, const char* fmt, va_list l) const; }; Index: Request.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Request.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Request.h 12 Sep 2006 00:29:01 -0000 1.6 --- Request.h 12 Sep 2006 15:23:32 -0000 1.7 *************** *** 93,96 **** --- 93,105 ---- const KeyValueMap& GetArguments() { return Arguments; } + /** + * Error logging method. + */ + void Error(const char* fmt, ...) const __attribute__ ((format (printf, 2, 3))); + + /** + * Debug message logging method. + */ + void Debug(const char* fmt, ...) const __attribute__ ((format (printf, 2, 3))); protected: /** *************** *** 109,112 **** --- 118,122 ---- */ request_context * RequestContext; + /** * The main application. Index: Session.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Session.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Session.h 12 Sep 2006 12:54:47 -0000 1.11 --- Session.h 12 Sep 2006 15:23:32 -0000 1.12 *************** *** 114,117 **** --- 114,122 ---- /** + * Gets the application to use. + */ + virtual EHTMLApplication* Application(void) { return _app; } + + /** * Connect to backend. * @return false on error. |
From: Gonzalo A. <ga...@us...> - 2006-09-12 14:50:19
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5569/src Modified Files: Dictionary.cpp Log Message: * Removed debugging messages. Index: Dictionary.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Dictionary.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Dictionary.cpp 12 Sep 2006 00:21:56 -0000 1.2 --- Dictionary.cpp 12 Sep 2006 14:50:04 -0000 1.3 *************** *** 55,61 **** istream& operator >> (istream& i, Dictionary& d) { char line[512]; - printf("reading session data\n"); while (!i.getline(line,sizeof(line)-1).eof()) { - printf("got line %s\n", line); char* _k = skip_ws(line); char* end = skip_word(_k); --- 55,59 ---- *************** *** 71,75 **** MemBuf mk(urldecode(k)); MemBuf mv(urldecode(v)); - printf("%s => %s\n", mk.AsString().c_str(), mv.AsString().c_str()); d[mk.AsString()] = mv.AsString(); } --- 69,72 ---- |
From: Gonzalo A. <ga...@us...> - 2006-09-12 14:34:43
|
Update of /cvsroot/mod-c/ehtml In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31705 Modified Files: TODO Log Message: * DiskSessionDriver should implement an idle wait (with a timeout) for locked sessions. Index: TODO =================================================================== RCS file: /cvsroot/mod-c/ehtml/TODO,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TODO 8 Sep 2006 14:33:03 -0000 1.2 --- TODO 12 Sep 2006 14:34:37 -0000 1.3 *************** *** 7,10 **** --- 7,12 ---- - Done: check how to implement session logging - Done: implement per-session persistent memory (global shared memory?) + - DiskSessionDriver: implement idle waiting for locked sessions. + Currently it does instantly returns an error if the session is locked. Events: |
From: Gonzalo A. <ga...@us...> - 2006-09-12 14:31:13
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30048/include Modified Files: Plugin.h Log Message: * gcc 3.1.1 does not emit Pluggable<SessionDriver>::_map symbols when using template<>. This patch makes gcc 3.1.1 happy again. Index: Plugin.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Plugin.h 12 Sep 2006 12:55:18 -0000 1.2 --- Plugin.h 12 Sep 2006 14:31:02 -0000 1.3 *************** *** 47,53 **** }; #define DECLARE_PLUGIN(C) \ ! template<> std::map<std::string,C*> Pluggable<C>::_map; \ ! template<> C* Pluggable<C>::_selected = NULL; //@TODO: write a plug-in registerer --- 47,59 ---- }; + #if __GNUC__ >= 4 + #define EXPLICIT_TEMPLATE template<> + #else + #define EXPLICIT_TEMPLATE + #endif + #define DECLARE_PLUGIN(C) \ ! EXPLICIT_TEMPLATE std::map<std::string,C*> Pluggable<C>::_map; \ ! EXPLICIT_TEMPLATE C* Pluggable<C>::_selected = NULL; //@TODO: write a plug-in registerer |
From: Gonzalo A. <ga...@us...> - 2006-09-12 12:55:22
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22836/include Modified Files: Plugin.h Log Message: * Make gcc-4.1.1 happy about DECLARE_PLUGIN macro. Index: Plugin.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Plugin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Plugin.h 8 Sep 2006 14:27:47 -0000 1.1 --- Plugin.h 12 Sep 2006 12:55:18 -0000 1.2 *************** *** 48,53 **** #define DECLARE_PLUGIN(C) \ ! map<string,C*> Pluggable<C>::_map; \ ! C* Pluggable<C>::_selected = NULL; //@TODO: write a plug-in registerer --- 48,53 ---- #define DECLARE_PLUGIN(C) \ ! template<> std::map<std::string,C*> Pluggable<C>::_map; \ ! template<> C* Pluggable<C>::_selected = NULL; //@TODO: write a plug-in registerer |
From: Gonzalo A. <ga...@us...> - 2006-09-12 12:54:50
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22445/include Modified Files: Session.h Log Message: * removed unnecessary include EHTMLApplication.h (gcc-4.1.1 unhappy with this). Index: Session.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Session.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Session.h 12 Sep 2006 00:26:09 -0000 1.10 --- Session.h 12 Sep 2006 12:54:47 -0000 1.11 *************** *** 27,31 **** #include "ehtml.h" - #include "EHTMLApplication.h" #include "Plugin.h" #include "Dictionary.h" --- 27,30 ---- |
From: Gonzalo A. <ga...@us...> - 2006-09-12 12:53:58
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22046/src Modified Files: DefaultSessionAddress.cpp Log Message: * g++-4.1.1 requires errno.h besides istringstream include. Index: DefaultSessionAddress.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/DefaultSessionAddress.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultSessionAddress.cpp 8 Sep 2006 14:30:59 -0000 1.1 --- DefaultSessionAddress.cpp 12 Sep 2006 12:53:55 -0000 1.2 *************** *** 4,7 **** --- 4,9 ---- #include <sstream> + #include <errno.h> + using namespace std; |
From: Gonzalo A. <ga...@us...> - 2006-09-12 12:53:18
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21643/src Modified Files: .cvsignore Log Message: * Ingore .la & .lo files. Index: .cvsignore =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 23 Aug 2006 14:42:38 -0000 1.1 --- .cvsignore 12 Sep 2006 12:53:14 -0000 1.2 *************** *** 2,3 **** --- 2,5 ---- .libs Makefile + *.la + *.lo |
From: Gonzalo A. <ga...@us...> - 2006-09-12 12:52:06
|
Update of /cvsroot/mod-c/ehtml/samples In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21203/samples Added Files: .cvsignore Log Message: Files to ignore on cvs diff, commit & import. --- NEW FILE: .cvsignore --- .deps .libs Makefile *.la *.lo |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:29:04
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4922/include Modified Files: Request.h Log Message: * Added Request::~Request destructor. * Added Request::GetCookie method. * Made Request::HeaderEntry smarter (to avoid possible segfault). Index: Request.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Request.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Request.h 6 Mar 2006 08:00:34 -0000 1.5 --- Request.h 12 Sep 2006 00:29:01 -0000 1.6 *************** *** 45,48 **** --- 45,53 ---- Request( EHTMLApplication * App ); + /** + * Destructor. + */ + virtual ~Request(); + /** * Returns the main request data object. *************** *** 114,117 **** --- 119,127 ---- KeyValueMap Arguments; + /** + * List of strings returned by <code>GetCookie(std::string& s) const</code>. + */ + mutable std::list<std::string> cookies_returned; + public: /** *************** *** 138,141 **** --- 148,164 ---- */ const char * Value; + + /** + * Default constructor. + */ + HeaderEntry(): Key(NULL), Value(NULL) { ; } + + HeaderEntry(const char* k, const char* v): + Key(strdup(k)), Value(strdup(v)) { ; } + + ~HeaderEntry() { + if (Key) free((void*)Key); + if (Value) free((void*)Value); + } }; /** *************** *** 151,154 **** --- 174,179 ---- */ HeaderEntryList HeaderCookies; + + const std::string* GetCookie(const std::string& name) const; }; |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:29:04
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4922/src Modified Files: Request.cpp Log Message: * Added Request::~Request destructor. * Added Request::GetCookie method. * Made Request::HeaderEntry smarter (to avoid possible segfault). Index: Request.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Request.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Request.cpp 11 Sep 2006 15:46:41 -0000 1.6 --- Request.cpp 12 Sep 2006 00:29:01 -0000 1.7 *************** *** 34,37 **** --- 34,45 ---- } + Request::~Request() { + while (!HeaderCookies.empty()) { + HeaderEntry* e = *HeaderCookies.begin(); + delete e; + HeaderCookies.pop_front(); + } + } + int Request::Prepare() { *************** *** 50,53 **** --- 58,62 ---- if ( r->args ) return ParseURLEncodedArgs( r->args, Arguments ); + PARSE_HEADER; break; *************** *** 120,126 **** --- 129,151 ---- } + const string* Request::GetCookie(const string& name) const { + printf("Looking for %s\n", name.c_str()); + string s = name + "="; + for (HeaderEntryList::const_iterator i = HeaderCookies.begin(); + i != HeaderCookies.end(); ++i) { + printf("cmp %s =? %s\n", name.c_str(), (*i)->Value); + if (!strncmp((*i)->Value, s.c_str(), s.length())) { + printf("got it! (%s)\n", (*i)->Value + name.length()+1); + cookies_returned.push_front(string((*i)->Value + name.length()+1)); + return &*cookies_returned.begin(); + } + } + return NULL; + } + void Request::ParseHeader() { const apr_array_header_t* arr = apr_table_elts( RequestContext->r->headers_in ); + printf("%s:%d\n", __PRETTY_FUNCTION__, __LINE__); if ( arr->nelts > 0 ) { *************** *** 136,139 **** --- 161,165 ---- if ( _key ) { + printf("Parsing %s\n", _key); switch ( _key[0] ) { *************** *** 154,158 **** if ( strncmp( "kie", _tmp + 1, 3 ) == 0 ) // We have a cookie ! HeaderCookies.push_back( ( HeaderEntry* ) tmp ); } // Is it Content-Length --- 180,185 ---- if ( strncmp( "kie", _tmp + 1, 3 ) == 0 ) // We have a cookie ! printf("Got cookie %s => %s\n", tmp->key, tmp->val); ! HeaderCookies.push_back( new HeaderEntry(tmp->key, tmp->val)); } // Is it Content-Length |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:26:50
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4490/src Modified Files: Response.cpp Log Message: * Added Response::SetCookie(const string& name, const string& value) method. Index: Response.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Response.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Response.cpp 6 Mar 2006 08:00:36 -0000 1.2 --- Response.cpp 12 Sep 2006 00:26:47 -0000 1.3 *************** *** 27,28 **** --- 27,35 ---- { } + + void Response::SetCookie(const std::string& name, const std::string& value) { + string val(name + "=" + value + "; path=/"); + apr_table_set(RequestContext->r->headers_out, + "Set-Cookie", val.c_str()); + } + |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:26:50
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4490/include Modified Files: Response.h Log Message: * Added Response::SetCookie(const string& name, const string& value) method. Index: Response.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Response.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Response.h 15 Feb 2006 22:33:19 -0000 1.3 --- Response.h 12 Sep 2006 00:26:47 -0000 1.4 *************** *** 45,48 **** --- 45,50 ---- inline request_context * GetRequestContext() { return RequestContext; } + void SetCookie(const std::string& name, const std::string& value); + protected: /** |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:26:12
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4084/src Modified Files: Session.cpp Log Message: * Added SessionID(MemBuf& mb) constructor. * Added bool Session::Expired() method. Index: Session.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Session.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Session.cpp 8 Sep 2006 14:30:59 -0000 1.12 --- Session.cpp 12 Sep 2006 00:26:09 -0000 1.13 *************** *** 27,30 **** --- 27,31 ---- string Session::_session_id_name( "ehtmlSID" ); + bool Session::_cookie_less = false; DECLARE_PLUGIN(SessionDriver); *************** *** 51,54 **** --- 52,62 ---- } + SessionID::SessionID(const MemBuf& mb): _binary(mb) { + _binary_set = 1; + _base64_set = 0; + _hex_set = 0; + _url_set = 0; + } + SessionID::SessionID(void* b, size_t nbytes, bool dup): _binary(b,nbytes) { if (dup) *************** *** 258,266 **** const string* id = Session::CookieLess() ? req->GetArgument(Session::SessionIDName()) : ! req->GetArgument(Session::SessionIDName()); ! /* @TODO req->GetCookie(Session::session_id_name()) */ ! //@todo TODO: MUST USE CONFIGURATION DIRECTIVE TO SEE WHICH ENCODING ! //IS TO BE USED. ! return id ? Get(SessionID((void*)id->c_str(), id->length())) : NULL; } --- 266,275 ---- const string* id = Session::CookieLess() ? req->GetArgument(Session::SessionIDName()) : ! req->GetCookie(Session::SessionIDName()); ! if (!id) ! return NULL; ! SessionID sid(hexdecode(*id)); ! printf("got sessionid = %s\n", sid.hex().c_str()); ! return Get(sid); } *************** *** 293,296 **** --- 302,306 ---- istream& operator >> (istream& i, Session& s) { i >> *static_cast<Dictionary*>(&s); + printf("Expires=%s\n",s["$$__EXPIRES$$"].c_str()); s.Expires(xatoul(s["$$__EXPIRES$$"].c_str())); s.erase("$$__EXPIRES$$"); |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:26:12
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4084/include Modified Files: Session.h Log Message: * Added SessionID(MemBuf& mb) constructor. * Added bool Session::Expired() method. Index: Session.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Session.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Session.h 8 Sep 2006 14:30:58 -0000 1.9 --- Session.h 12 Sep 2006 00:26:09 -0000 1.10 *************** *** 50,53 **** --- 50,54 ---- SessionID(); SessionID(const SessionID& id); + SessionID(const MemBuf& mb); SessionID(void* b, size_t nbytes, bool dup = false); ~SessionID(); *************** *** 311,314 **** --- 312,320 ---- time_t Expires(void) { return _expires; } + /** + * Checks if current session is expired. + */ + bool Expired(void) { return (_expires != 0) && (_expires < time(NULL)); } + //{set,get,unset}Value: use operator[](), find(), erase(). |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:25:50
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2869/src Modified Files: DiskSessionDriver.cpp Log Message: * Cosmetic change: id.hex() is coded in a single place (eaiser to update in the near future). * Cosmetic change in DiskSessionDriver::Get(). * Bugfix: the session has to be created with the propper ID. * Bugfix: inconsistent session data has to get triggered. * Bugfix: expiration calculation was wrong. * Bugfix: DiskSessionDriver::Release: is rename(old,new), not rename(new,old). Index: DiskSessionDriver.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/DiskSessionDriver.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DiskSessionDriver.cpp 8 Sep 2006 14:30:59 -0000 1.1 --- DiskSessionDriver.cpp 12 Sep 2006 00:25:19 -0000 1.2 *************** *** 15,20 **** uint32_t collect_prob; time_t old_enough; ! string filename(const string& id); ! string locked_filename(const string& id); public: DiskSessionDriver(): connected(false), collect_prob(1), old_enough(86400) { ; } --- 15,20 ---- uint32_t collect_prob; time_t old_enough; ! string filename(const SessionID& id); ! string locked_filename(const SessionID& id); public: DiskSessionDriver(): connected(false), collect_prob(1), old_enough(86400) { ; } *************** *** 34,43 **** }; ! string DiskSessionDriver::filename(const string& hexid) { ! return spool + "/" + hexid; } ! string DiskSessionDriver::locked_filename(const string& hexid) { ! return filename(hexid) + ",$$"; } --- 34,43 ---- }; ! string DiskSessionDriver::filename(const SessionID& id) { ! return spool + "/" + id.hex(); } ! string DiskSessionDriver::locked_filename(const SessionID& id) { ! return filename(id) + ",$$"; } *************** *** 114,129 **** return NULL; mayBeCollect(); ! string name = filename(id.hex()); ! string lname = locked_filename(id.hex()); ! if (rename(name.c_str(), lname.c_str())) return NULL; ! Session* dev = new Session(); ifstream in(lname.c_str()); ! in >> *dev; if (!in.eof()) { delete dev; return NULL; } ! if (dev->Expires() < time(NULL)) { unlink(lname.c_str()); delete dev; --- 114,142 ---- return NULL; mayBeCollect(); ! string name = filename(id); ! string lname = locked_filename(id); ! printf("name %s / %s\n", name.c_str(), lname.c_str()); ! if (rename(name.c_str(), lname.c_str())) { ! printf("Error: stale session (id=%s, rename error=%s)\n", ! id.hex().c_str(), strerror(errno)); return NULL; ! } ! Session* dev = new Session(id); ifstream in(lname.c_str()); ! try { ! in >> *dev; ! } catch (const char*) { ! printf("Error: corrupt session state (id=%s)\n", id.hex().c_str()); ! delete dev; ! return NULL; ! } if (!in.eof()) { + printf("Error: corrupt session state (%s)\n", id.hex().c_str()); delete dev; return NULL; } ! if (dev->Expired()) { ! printf("Error: expired session (id=%s, expires=%lu, now=%lu)\n", ! id.hex().c_str(), dev->Expires(), time(NULL)); unlink(lname.c_str()); delete dev; *************** *** 137,141 **** if (!connected) return false; ! string lfile = locked_filename(s->ID().hex()); ofstream out(lfile.c_str()); if (!out) --- 150,154 ---- if (!connected) return false; ! string lfile = locked_filename(s->ID()); ofstream out(lfile.c_str()); if (!out) *************** *** 148,153 **** if (!connected) return false; ! unlink(filename(s->ID().hex()).c_str()); ! unlink(locked_filename(s->ID().hex()).c_str()); } --- 161,166 ---- if (!connected) return false; ! unlink(filename(s->ID()).c_str()); ! unlink(locked_filename(s->ID()).c_str()); } *************** *** 155,160 **** if (!connected) return false; ! return rename(locked_filename(s->ID().hex()).c_str(), ! filename(s->ID().hex()).c_str()) == 0 ? true : false; } --- 168,176 ---- if (!connected) return false; ! string name(filename(s->ID())); ! string lname(locked_filename(s->ID())); ! int status = rename(lname.c_str(), name.c_str()); ! printf("rename(%s,%s): %d\n", lname.c_str(), name.c_str(), status); ! return status ? false : true; } |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:21:59
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2452/src Modified Files: Dictionary.cpp Log Message: Bugfix: istringstream.eof() is signalled before the actual eof. Index: Dictionary.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Dictionary.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dictionary.cpp 8 Sep 2006 14:27:10 -0000 1.1 --- Dictionary.cpp 12 Sep 2006 00:21:56 -0000 1.2 *************** *** 55,69 **** istream& operator >> (istream& i, Dictionary& d) { char line[512]; ! while (!i.getline(line,sizeof(line)-1)) { ! istringstream l(line); ! string k, v; ! l >> k; ! if (!l); throw "Invalid input stream"; ! l >> v; ! if (!l.eof()) throw "Invalid input stream"; // should check that urldecode(k) is not present. ! d[urldecode(k).AsString()] = urldecode(v).AsString(); } return i; --- 55,76 ---- istream& operator >> (istream& i, Dictionary& d) { char line[512]; ! printf("reading session data\n"); ! while (!i.getline(line,sizeof(line)-1).eof()) { ! printf("got line %s\n", line); ! char* _k = skip_ws(line); ! char* end = skip_word(_k); ! if (!*end) throw "Invalid input stream"; ! *end++ = '\0'; ! char* _v = skip_ws(end); ! if (!*_v) throw "Invalid input stream"; + + string k(_k), v(_v); // should check that urldecode(k) is not present. ! MemBuf mk(urldecode(k)); ! MemBuf mv(urldecode(v)); ! printf("%s => %s\n", mk.AsString().c_str(), mv.AsString().c_str()); ! d[mk.AsString()] = mv.AsString(); } return i; |
From: Gonzalo A. <ga...@us...> - 2006-09-12 00:21:14
|
Update of /cvsroot/mod-c/ehtml/samples In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2036/samples Modified Files: 02session.cpp Log Message: * Bugfix: session variable "count" has to be a string. * Bugfix: the session has to be released upon request termination. Index: 02session.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/samples/02session.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 02session.cpp 8 Sep 2006 14:28:17 -0000 1.1 --- 02session.cpp 12 Sep 2006 00:21:09 -0000 1.2 *************** *** 80,86 **** } else { cnt = atoi((*session)[COUNT].c_str()); ! (*session)[COUNT] = cnt + 1; } lblCount.SetText("count = " + (*session)[COUNT]); } --- 80,93 ---- } else { cnt = atoi((*session)[COUNT].c_str()); ! ++cnt; ! char scnt[12]; ! sprintf(scnt, "%lu", cnt); ! (*session)[COUNT] = scnt; } lblCount.SetText("count = " + (*session)[COUNT]); + printf("session id=%s\n", session->ID().hex().c_str()); + GetResponse()->SetCookie(Session::SessionIDName(), + session->ID().hex()); + } *************** *** 90,93 **** --- 97,101 ---- virtual int DoFinishStage() { if (session && driver) { + printf("session id=%s\n", session->ID().hex().c_str()); if (!driver->Save(session)) { ap_log_error(APLOG_MARK, LOG_ERR, 0, *************** *** 97,100 **** --- 105,119 ---- strerror(errno)); } + + if (!driver->Release(session)) { + ap_log_error(APLOG_MARK, LOG_ERR, 0, + Request->GetRequestContext()->r->server, + "Error releasing session (hex=%s): %s", + session->ID().hex().c_str(), + strerror(errno)); + } + + //@todo TODO: MUST USE CONFIGURATION DIRECTIVE TO SEE WHICH ENCODING + //IS TO BE USED. if (!driver->Disconnect()) { ap_log_error(APLOG_MARK, LOG_ERR, 0, |
From: Gonzalo A. <ga...@us...> - 2006-09-11 23:17:09
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8365/src Modified Files: Common.cpp Log Message: Added skip_ws, skip_word functions. Index: Common.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Common.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Common.cpp 8 Sep 2006 20:59:02 -0000 1.8 --- Common.cpp 11 Sep 2006 23:17:06 -0000 1.9 *************** *** 473,474 **** --- 473,494 ---- } + const char* skip_ws(const char* s) { + while (isspace(*s)) ++s; + return s; + } + + char* skip_ws(char* s) { + while (isspace(*s)) ++s; + return s; + } + + const char* skip_word(const char* s) { + while (!isspace(*s) && *s) ++s; + return s; + } + + char* skip_word(char* s) { + while (!isspace(*s) && *s) ++s; + return s; + } + |
From: Gonzalo A. <ga...@us...> - 2006-09-11 23:17:09
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8365/include Modified Files: Common.h Log Message: Added skip_ws, skip_word functions. Index: Common.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Common.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Common.h 8 Sep 2006 20:59:30 -0000 1.9 --- Common.h 11 Sep 2006 23:17:06 -0000 1.10 *************** *** 197,200 **** --- 197,205 ---- void* xmemdup(const void* p, size_t n); + const char* skip_ws(const char* s); + char* skip_ws(char* s); + const char* skip_word(const char* s); + char* skip_word(char* s); + #ifdef DEBUG #define ASSERT( expr ) {\ |
From: Gonzalo A. <ga...@us...> - 2006-09-11 15:46:45
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6651/src Modified Files: Request.cpp Log Message: Bugfix: HeaderEntry is not a const char*, but rather a pair of const char*. Index: Request.cpp =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Request.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Request.cpp 23 Aug 2006 10:32:57 -0000 1.5 --- Request.cpp 11 Sep 2006 15:46:41 -0000 1.6 *************** *** 154,158 **** if ( strncmp( "kie", _tmp + 1, 3 ) == 0 ) // We have a cookie ! HeaderCookies.push_back( ( HeaderEntry* ) _tmp ); } // Is it Content-Length --- 154,158 ---- if ( strncmp( "kie", _tmp + 1, 3 ) == 0 ) // We have a cookie ! HeaderCookies.push_back( ( HeaderEntry* ) tmp ); } // Is it Content-Length |
From: Gonzalo A. <ga...@us...> - 2006-09-11 14:02:49
|
Update of /cvsroot/mod-c/mod_c In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28018 Modified Files: configure.ac Log Message: AC_PROG_RANLIB is obsolete if using AM_PROG_LIBTOOL. Index: configure.ac =================================================================== RCS file: /cvsroot/mod-c/mod_c/configure.ac,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** configure.ac 11 Sep 2006 13:58:44 -0000 1.8 --- configure.ac 11 Sep 2006 14:02:42 -0000 1.9 *************** *** 12,16 **** AC_PROG_CC AM_PROG_LIBTOOL ! AC_PROG_RANLIB # Check for needed headers --- 12,16 ---- AC_PROG_CC AM_PROG_LIBTOOL ! dnl AC_PROG_RANLIB # Check for needed headers |
From: Gonzalo A. <ga...@us...> - 2006-09-11 13:58:50
|
Update of /cvsroot/mod-c/mod_c In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26308 Modified Files: configure.ac Log Message: dss_tool is now in ehtml side. Index: configure.ac =================================================================== RCS file: /cvsroot/mod-c/mod_c/configure.ac,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** configure.ac 23 Aug 2006 16:21:58 -0000 1.7 --- configure.ac 11 Sep 2006 13:58:44 -0000 1.8 *************** *** 148,152 **** src/Makefile include/Makefile - src/dss_tool/Makefile doc/Makefile]) --- 148,151 ---- |
From: Gonzalo A. <ga...@us...> - 2006-09-08 21:01:33
|
Update of /cvsroot/mod-c/ehtml In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18196 Modified Files: ChangeLog Log Message: Added a note about testbed for Common.cpp. Index: ChangeLog =================================================================== RCS file: /cvsroot/mod-c/ehtml/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ChangeLog 8 Sep 2006 17:37:29 -0000 1.4 --- ChangeLog 8 Sep 2006 21:01:29 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- generator than the one provided by libc. * Wrote {url,hex,base64}{en,de}code (Common.cpp). + * Added a testbench for Common.cpp routines. 2006-08-25 Gonzalo A. Arana <gon...@gm...> |
From: Gonzalo A. <ga...@us...> - 2006-09-08 21:00:49
|
Update of /cvsroot/mod-c/ehtml/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17786/src Modified Files: Makefile.am Added Files: testCommon.cpp Log Message: Added a testbed for Common routines. Index: Makefile.am =================================================================== RCS file: /cvsroot/mod-c/ehtml/src/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 8 Sep 2006 14:37:07 -0000 1.6 --- Makefile.am 8 Sep 2006 21:00:46 -0000 1.7 *************** *** 14,17 **** --- 14,18 ---- lib_LTLIBRARIES = libehtml.la libsession.la libdisksession.la libsessionid.la bin_PROGRAMS = mod_c_dss + noinst_PROGRAMS = testCommon EHTML_SOURCES = Common.cpp *************** *** 54,57 **** --- 55,60 ---- libsessionid_la_LDFLAGS = -shared -module + testCommon_SOURCES = testCommon.cpp + #SUBDIRS = dss_tool --- NEW FILE: testCommon.cpp --- #include "Common.cpp" #include "MemBuf.cpp" const char* test[][4] = { { "azAZ09%a%%b", /* plain */ "azAZ09%25a%25%25b", /* url */ "617a415a30392561252562", /* hex */ "YXpBWjA5JWElJWI=" /* b64 */ }, { "a", /* plain */ "a", /* url */ "61", /* hex */ "YQ==" /* b64 */ }, { "ab", /* plain */ "ab", /* url */ "6162", /* hex */ "YWI=" /* b64 */ }, { "abc", /* plain */ "abc", /* url */ "616263", /* hex */ "YWJj", /* b64 */ }, { "abcd", /* plain */ "abcd", /* url */ "61626364", /* hex */ "YWJjZA==" /* b64 */ }, { "abcde", /* plain */ "abcde", /* url */ "6162636465", /* hex */ "YWJjZGU=" /* b64 */ } }; #define NTEST (sizeof(test)/sizeof(test[0])) int main(int argc, char* argv[]) { string s; MemBuf mb; int fail = 0; for (int i = 0; i < NTEST; ++i) { printf("Testing encodings for %s\n", test[i][0]); s = urlencode(test[i][0]); if (strcmp(test[i][1], s.c_str())) { printf("\tURL_FAILED \"%s\" != \"%s\"\n", test[i][1], s.c_str()); ++fail; } mb = urldecode(s); if (strncmp(test[i][0], mb.Char(), mb.Size())) { printf("\tURL_FAILEDr \"%s\" != \"%s\"\n", test[i][0], mb.Char()); ++fail; } s = hexencode(test[i][0]); if (strcasecmp(test[i][2], s.c_str())) { printf("\tHEX_FAILED \"%s\" != \"%s\"\n", test[i][2], s.c_str()); ++fail; } mb = hexdecode(s); if (strncmp(test[i][0], mb.Char(), mb.Size())) { printf("\tHEX_FAILEDr \"%s\" != \"%s\"\n", test[i][0], mb.Char()); ++fail; } s = base64encode(test[i][0]); if (strcmp(test[i][3], s.c_str())) { printf("\tB64_FAILED \"%s\" != \"%s\"\n", test[i][3], s.c_str()); ++fail; } mb = base64decode(s); if (strncmp(test[i][0], mb.Char(), mb.Size())) { printf("\tB64_FAILEDr \"%s\" != \"%s\"\n", test[i][0], mb.Char()); ++fail; } } puts(fail ? "FAIL" : "OK"); return fail ? 1 : 0; } |