if (imap_read_line_d (buf, sizeof (buf), ctx->fd) < 0)
if (imap_read_line_d (buf, sizeof (buf), CTX_DATA->conn) < 0)
static int imap_read_header (CONTEXT *ctx, int msgno){  char buf[LONG_STRING];  FILE *fp;  char tempfile[_POSIX_PATH_MAX];  char seq[8];  char *pc;  char *pn;  long bytes;  ctx->hdrs[ctx->msgcount]->index = ctx->msgcount;  mutt_mktemp (tempfile);  if (!(fp = safe_fopen (tempfile, "w+")))  {    return (-1);  }  imap_make_sequence (seq, sizeof (seq), ctx);  snprintf (buf, sizeof (buf), "%s FETCH %d RFC822.HEADER\r\n", seq, msgno + 1);  imap_write (ctx->fd, buf);  do  {    if (imap_read_line (buf, sizeof (buf), ctx->fd) < 0)    {      return (-1);    }    if (buf[0] == '*')    {      pc = buf;      pc = imap_next_word (pc);      pc = imap_next_word (pc);      if (strncasecmp ("FETCH", pc, 5) == 0)      {	if (!(pc = strchr (pc, '{')))	{	  imap_error ("imap_read_header()", buf);	  return (-1);	}	pc++;	pn = pc;	while (isdigit (*pc))	  pc++;	*pc = 0;	bytes = atoi (pn);	imap_read_bytes (fp, ctx->fd, bytes);      }      else if (imap_handle_untagged (ctx, buf) != 0)	  return (-1);    }  }  while (strncmp (seq, buf, SEQLEN) != 0);  rewind (fp);  ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno]);  fclose (fp);  unlink (tempfile);  /* get the status of this message */  imap_make_sequence (seq, sizeof (seq), ctx);  snprintf (buf, sizeof (buf), "%s FETCH %d FAST\r\n", seq, msgno + 1);  imap_write (ctx->fd, buf);  do  {    if (imap_read_line_d (buf, sizeof (buf), ctx->fd) < 0)      break;    if (buf[0] == '*')    {      pc = buf;      pc = imap_next_word (pc);      pc = imap_next_word (pc);      if (strncasecmp ("FETCH", pc, 5) == 0)      {	if (!(pc = strchr (pc, '(')))	{	  imap_error ("imap_read_header()", buf);	  return (-1);	}	if (imap_parse_fetch (ctx->hdrs[msgno], pc + 1) != 0)	  return (-1);      }      else if (imap_handle_untagged (ctx, buf) != 0)	return (-1);    }  }  while (strncmp (seq, buf, SEQLEN) != 0)    ;  return 0;}