FOREVER {
chunk = mutt_socket_readln_d (buf, sizeof (buf), nntp_data->nserv->conn,
FOREVER {
chunk = mutt_socket_readln_d (buf, sizeof (buf), nntp_data->nserv->conn,
debug_print (2, ("group: %s, desc: %s\n", line, d));
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, line)) != NULL &&
str_cmp (d, data->desc)) {
debug_print (2, ("group: %s, desc: %s\n", line, d));
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, line)) != NULL &&
str_cmp (d, data->desc)) {
b = b + 6; /* skips the "Xref: " */
hdr->env->xref = str_dup (b);
nntp_parse_xref (ctx, nntp_data->group, b, hdr);
b = b + 6; /* skips the "Xref: " */
hdr->env->xref = str_dup (b);
nntp_parse_xref (ctx, nntp_data->group, b, hdr);
if (nntp_data->nserv->hasLISTGROUP) {
snprintf (buf, sizeof (buf), "LISTGROUP %s\r\n", nntp_data->group);
if (mutt_nntp_fetch (nntp_data, buf, NULL, nntp_fetch_numbers, &fc, 0) !=
if (nntp_data->nserv->hasLISTGROUP) {
snprintf (buf, sizeof (buf), "LISTGROUP %s\r\n", nntp_data->group);
if (mutt_nntp_fetch (nntp_data, buf, NULL, nntp_fetch_numbers, &fc, 0) !=
mutt_nntp_query (nntp_data, buf, sizeof (buf));
if (sscanf (buf + 4, "%d %u %u %s", &num, &fc.first, &fc.last, buf) != 4) {
mutt_error (_("GROUP command failed: %s"), buf);
mutt_nntp_query (nntp_data, buf, sizeof (buf));
if (sscanf (buf + 4, "%d %u %u %s", &num, &fc.first, &fc.last, buf) != 4) {
mutt_error (_("GROUP command failed: %s"), buf);
/* create NNTP-specific state struct if nof found in list */
if ((nntp_data = (NNTP_DATA *) hash_find (serv->newsgroups, buf)) == NULL) {
/* create NNTP-specific state struct if nof found in list */
if ((nntp_data = (NNTP_DATA *) hash_find (serv->newsgroups, buf)) == NULL) {
nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA);
strcpy (nntp_data->group, buf);
hash_insert (serv->newsgroups, nntp_data->group, nntp_data, 0);
nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA);
strcpy (nntp_data->group, buf);
hash_insert (serv->newsgroups, nntp_data->group, nntp_data, 0);
mutt_mktemp (path);
cache->path = str_dup (path);
if (!(msg->fp = safe_fopen (path, "w+"))) {
mutt_mktemp (path);
cache->path = str_dup (path);
if (!(msg->fp = safe_fopen (path, "w+"))) {
for (i = 0; i < NNTP_CACHE_LEN; i++) {
if (data->acache[i].path) {
unlink (data->acache[i].path);
for (i = 0; i < NNTP_CACHE_LEN; i++) {
if (data->acache[i].path) {
unlink (data->acache[i].path);
nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA);
strcpy (nntp_data->group, group);
nntp_data->nserv = s;
nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA);
strcpy (nntp_data->group, group);
nntp_data->nserv = s;
if (mutt_nntp_fetch (nntp_data, buf, NULL, check_children, &cc, 0)) {
if (mutt_nntp_fetch (nntp_data, buf, NULL, check_children, &cc, 0)) {