projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da65335
)
Implemented the NNTP DATE command.
author
Art Cancro
<ajc@uncensored.citadel.org>
Wed, 5 Mar 2014 19:37:01 +0000
(14:37 -0500)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Wed, 5 Mar 2014 19:37:01 +0000
(14:37 -0500)
citadel/modules/nntp/serv_nntp.c
patch
|
blob
|
history
diff --git
a/citadel/modules/nntp/serv_nntp.c
b/citadel/modules/nntp/serv_nntp.c
index 198261005328147f5f2e03695377f99c9ab74425..f32ce1d733a095a2088cb1a6675dd6c8b563a86d 100644
(file)
--- a/
citadel/modules/nntp/serv_nntp.c
+++ b/
citadel/modules/nntp/serv_nntp.c
@@
-531,6
+531,25
@@
void nntp_help(void) {
}
}
+//
+// Implement DATE command.
+//
+void nntp_date(void) {
+ time_t now;
+ struct tm nowLocal;
+ struct tm nowUtc;
+ char tsFromUtc[32];
+
+ now = time(NULL);
+ localtime_r(&now, &nowLocal);
+ gmtime_r(&now, &nowUtc);
+
+ strftime(tsFromUtc, sizeof(tsFromUtc), "%Y%m%d%H%M%S", &nowUtc);
+
+ cprintf("111 %s\r\n", tsFromUtc);
+}
+
+
//
// back end for the LISTGROUP command , called for each message number
//
//
// back end for the LISTGROUP command , called for each message number
//
@@
-949,6
+968,10
@@
void nntp_command_loop(void)
nntp_help();
}
nntp_help();
}
+ else if (!strcasecmp(cmdname, "date")) {
+ nntp_date();
+ }
+
else if (!strcasecmp(cmdname, "capabilities")) {
nntp_capabilities();
}
else if (!strcasecmp(cmdname, "capabilities")) {
nntp_capabilities();
}