projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f807e31
)
Global warming is a socialist communist scam.
author
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 20 Mar 2014 16:16:03 +0000
(12:16 -0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 20 Mar 2014 16:16:03 +0000
(12:16 -0400)
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 a14dae68fb96493da997b90fc7009e490c66cbcf..3473b49e391e749540fb38b90a50f54302e8474c 100644
(file)
--- a/
citadel/modules/nntp/serv_nntp.c
+++ b/
citadel/modules/nntp/serv_nntp.c
@@
-960,6
+960,22
@@
void nntp_last_next(const char *cmd) {
}
}
+//
+// back end for the XOVER command , called for each message number
+//
+void nntp_xover_backend(long msgnum, void *userdata) {
+
+ struct listgroup_range *lr = (struct listgroup_range *)userdata;
+
+ // check range if supplied
+ if (msgnum < lr->lo) return;
+ if ((lr->hi != 0) && (msgnum > lr->hi)) return;
+
+ cprintf("FIXME %ld FIXME\r\n", msgnum); // FIXME need to actually show the overview data
+}
+
+
+//
//
// XOVER is used by some clients, even if we don't offer it
//
//
// XOVER is used by some clients, even if we don't offer it
//
@@
-968,33
+984,34
@@
void nntp_xover(const char *cmd) {
citnntp *nntpstate = (citnntp *) CC->session_specific_data;
char range[256];
citnntp *nntpstate = (citnntp *) CC->session_specific_data;
char range[256];
- long lowest = (-1) ;
- long highest = (-1) ;
+ struct listgroup_range lr;
extract_token(range, cmd, 1, ' ', sizeof range);
extract_token(range, cmd, 1, ' ', sizeof range);
- l
owest
= atol(range);
- if (l
owest
<= 0) {
- l
owest
= nntpstate->current_article_number;
-
highest
= nntpstate->current_article_number;
+ l
r.lo
= atol(range);
+ if (l
r.lo
<= 0) {
+ l
r.lo
= nntpstate->current_article_number;
+
lr.hi
= nntpstate->current_article_number;
}
else {
char *dash = strchr(range, '-');
if (dash != NULL) {
++dash;
}
else {
char *dash = strchr(range, '-');
if (dash != NULL) {
++dash;
-
highest
= atol(dash);
- if (
highest
== 0) {
-
highest
= LONG_MAX;
+
lr.hi
= atol(dash);
+ if (
lr.hi
== 0) {
+
lr.hi
= LONG_MAX;
}
}
- if (
highest < lowest
) {
-
highest = lowest
;
+ if (
lr.hi < lr.lo
) {
+
lr.hi = lr.lo
;
}
}
else {
}
}
else {
-
highest = lowest
;
+
lr.hi = lr.lo
;
}
}
}
}
- cprintf("500 not implemented yet FIXME lowest=%ld highest=%ld\r\n", lowest, highest);
+ cprintf("224 Overview information follows\r\n");
+ CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, nntp_xover_backend, &lr);
+ cprintf(".\r\n");
}
}