Skip to content
Snippets Groups Projects
Commit 80eb72ce authored by rswindell's avatar rswindell
Browse files

Fix problem reported by Nelgin:

The GROUP command reports the total number of articles in a group and we
were returning the total number of message indexes/headers, which includes
vote messages (not retrievable/viewable via NNTP) and messages flagged for
deletion (not retrievable/viewable via NNTP). So, count the actual
number of non-vote/deleted messages (index records) to use in the GROUP
response.
parent 94e61d9b
No related branches found
No related tags found
No related merge requests found
......@@ -454,18 +454,28 @@ while(client.socket.is_connected && !quit) {
break;
}
if(cmd[0].toUpperCase()=="GROUP")
if(cmd[0].toUpperCase()=="GROUP") {
var total_msgs = msgbase.total_msgs;
var count = 0;
for(i=0;i<total_msgs;i++) {
var idx=msgbase.get_msg_index(/* by_offset */true,i);
if(idx==null)
continue;
if(idx.attr&MSG_DELETE) /* marked for deletion */
continue;
count++;
}
writeln(format("211 %u %u %d %s group selected"
,msgbase.total_msgs // articles in group
,count // articles in group
,msgbase.first_msg
,(msgbase.total_msgs==0) ? (msgbase.first_msg-1):msgbase.last_msg
,(count==0) ? (msgbase.first_msg-1):msgbase.last_msg
,selected.newsgroup
));
else { // LISTGROUP
} else { // LISTGROUP
writeln("211 list of article numbers follow");
var total_msgs = msgbase.total_msgs;
for(i=0;i<total_msgs;i++) {
idx=msgbase.get_msg_index(/* by_offset */true,i);
var idx=msgbase.get_msg_index(/* by_offset */true,i);
if(idx==null)
continue;
if(idx.attr&MSG_DELETE) /* marked for deletion */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment