From: Art Cancro Date: Wed, 19 Mar 2014 20:28:06 +0000 (-0400) Subject: Implemented the range handling code for XOVER X-Git-Tag: v9.01~122^2~9 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=0adb29d5fa73df9c3760478405aaf71fa37054c4 Implemented the range handling code for XOVER --- diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index 78043d3fa..e4897d6c3 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -966,9 +966,35 @@ void nntp_last_next(const char *cmd) { void nntp_xover(const char *cmd) { if (CtdlAccessCheck(ac_logged_in_or_guest)) return; - // citnntp *nntpstate = (citnntp *) CC->session_specific_data; + citnntp *nntpstate = (citnntp *) CC->session_specific_data; + char range[256]; + long lowest = (-1) ; + long highest = (-1) ; + + extract_token(range, cmd, 1, ' ', sizeof range); + lowest = atol(range); + if (lowest <= 0) { + lowest = nntpstate->current_article_number; + highest = nntpstate->current_article_number; + } + else { + char *dash = strchr(range, '-'); + if (dash != NULL) { + ++dash; + highest = atol(dash); + if (highest == 0) { + highest = LONG_MAX; + } + if (highest < lowest) { + highest = lowest; + } + } + else { + highest = lowest; + } + } - cprintf("500 not implemented yet FIXME\r\n"); + cprintf("500 not implemented yet FIXME lowest=%ld highest=%ld\r\n", lowest, highest); }