+ *size = 0;
+
+ wxString s,
+ afterDate;
+ if ( item.StartsWith("Date", &afterDate) )
+ {
+ const wxDateTime now = wxDateTime::Now();
+
+ if ( afterDate.empty() )
+ {
+ s = now.Format();
+ *size = wxNO_LEN;
+ }
+ else if ( afterDate == "+len" )
+ {
+ s = now.FormatTime() + " " + now.FormatDate();
+ *size = strlen(s.mb_str()) + 1;
+ }
+ }
+ else if ( item == "bytes[3]" )
+ {
+ s = "123";
+ *size = 3;
+ }
+
+ if ( !*size )
+ {
+ wxLogMessage("Unknown request for \"%s\"", item);
+ return NULL;
+ }
+
+ // store the data pointer to which we return in a member variable to ensure
+ // that the pointer remains valid even after we return
+ m_requestData = s.mb_str();
+ const void * const data = m_requestData;
+ Log("OnRequest", topic, item, data, *size, format);
+ return data;