Changeset 456:da859aef10ab

Show
Ignore:
Timestamp:
1998-10-14 18:17:41 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Fixing a memory hog which was introduced by the edit-message patch.

Files:
12 modified

Legend:

Unmodified
Added
Removed
  • buffy.c

    r437 r456  
    9898 
    9999  hdr = mutt_new_header (); 
    100   mutt_read_rfc822_header (f, hdr); 
     100  mutt_read_rfc822_header (f, hdr, 0); 
    101101  if (!(hdr->read || hdr->old)) 
    102102    result = 1; 
  • headers.c

    r437 r456  
    130130  ifp = fopen (path, "r"); 
    131131  ofp = safe_fopen (body, "w"); 
    132   n = mutt_read_rfc822_header (ifp, NULL); 
     132  n = mutt_read_rfc822_header (ifp, NULL, 1); 
    133133  while ((i = fread (buffer, 1, sizeof (buffer), ifp)) > 0) 
    134134    fwrite (buffer, 1, i, ofp); 
  • imap.c

    r437 r456  
    532532    ctx->hdrs[ctx->msgcount]->index = ctx->msgcount; 
    533533 
    534     ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno]); 
     534    ctx->hdrs[msgno]->env = mutt_read_rfc822_header (fp, ctx->hdrs[msgno], 0); 
    535535    ploc=ftell(fp); 
    536536    ctx->hdrs[msgno]->read = h->read; 
  • main.c

    r446 r456  
    569569 
    570570      if (draftFile) 
    571         msg->env = mutt_read_rfc822_header (fin, NULL); 
     571        msg->env = mutt_read_rfc822_header (fin, NULL, 1); 
    572572 
    573573      if (tempfile) 
  • mbox.c

    r437 r456  
    136136        hdr->received = t + tz; 
    137137 
    138       hdr->env = mutt_read_rfc822_header (ctx->fp, hdr); 
     138      hdr->env = mutt_read_rfc822_header (ctx->fp, hdr, 0); 
    139139 
    140140      loc = ftell (ctx->fp); 
     
    271271      curhdr->index = ctx->msgcount; 
    272272         
    273       curhdr->env = mutt_read_rfc822_header (ctx->fp, curhdr); 
     273      curhdr->env = mutt_read_rfc822_header (ctx->fp, curhdr, 0); 
    274274 
    275275      /* if we know how long this message is, either just skip over the body, 
  • mh.c

    r437 r456  
    133133  { 
    134134    h = mutt_new_header(); 
    135     h->env = mutt_read_rfc822_header (f, h); 
     135    h->env = mutt_read_rfc822_header (f, h, 0); 
    136136 
    137137    fstat (fileno (f), &st); 
  • parse.c

    r453 r456  
    424424  parent->hdr = mutt_new_header (); 
    425425  parent->hdr->offset = ftell (fp); 
    426   parent->hdr->env = mutt_read_rfc822_header (fp, parent->hdr); 
     426  parent->hdr->env = mutt_read_rfc822_header (fp, parent->hdr, 0); 
    427427  msg = parent->hdr->content; 
    428428 
     
    836836 * f            stream to read from 
    837837 * 
    838  * hdr          header structure of current message (optional).  If hdr is 
    839  *              NULL, then we are reading a postponed message, or called 
    840  *              from mutt_edit_headers() so we should keep a list of the 
    841  *              user-defined headers. 
     838 * hdr          header structure of current message (optional). 
     839 *  
     840 * user_hdrs    If set, store user headers.  Used for edit-message and  
     841 *              postpone modes. 
     842 *  
    842843 */ 
    843 ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr) 
     844ENVELOPE *mutt_read_rfc822_header (FILE *f, HEADER *hdr, short user_hdrs) 
    844845{ 
    845846  ENVELOPE *e = mutt_new_envelope(); 
     
    11571158 
    11581159     /* Keep track of the user-defined headers */ 
    1159     if (!matched) 
     1160    if (!matched && user_hdrs) 
    11601161    { 
    11611162      if (last) 
  • parse.h

    r437 r456  
    11/* $Id$ */ 
     2 
     3/* XXX this file duplicates content from protos.h */ 
     4 
    25BODY *mutt_parse_multipart (FILE *, const char *, long, int); 
    36BODY *mutt_parse_messageRFC822 (FILE *, BODY *); 
    47BODY *mutt_read_mime_header (FILE *, int); 
    58 
    6 ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *); 
     9ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short); 
    710 
    811time_t is_from (const char *, char *, size_t); 
  • po/mutt.pot

    r455 r456  
    77msgstr "" 
    88"Project-Id-Version: PACKAGE VERSION\n" 
    9 "POT-Creation-Date: 1998-10-15 00:54+0200\n" 
     9"POT-Creation-Date: 1998-10-15 03:08+0200\n" 
    1010"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1111"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    27612761msgstr "" 
    27622762 
    2763 #: sendlib.c:1694 
     2763#: sendlib.c:1695 
    27642764#, c-format 
    27652765msgid "Error sending message, child exited %d (%s).\n" 
    27662766msgstr "" 
    27672767 
    2768 #: sendlib.c:1696 
     2768#: sendlib.c:1697 
    27692769#, c-format 
    27702770msgid "Saved output of child process to %s.\n" 
    27712771msgstr "" 
    27722772 
    2773 #: sendlib.c:1700 
     2773#: sendlib.c:1701 
    27742774msgid "Error sending message." 
    27752775msgstr "" 
  • postpone.c

    r437 r456  
    381381 
    382382  fseek (msg->fp, hdr->offset, 0); 
    383   newhdr->env = mutt_read_rfc822_header (msg->fp, newhdr); 
     383  newhdr->env = mutt_read_rfc822_header (msg->fp, newhdr, 1); 
    384384 
    385385  if (hdr->content->type == TYPEMESSAGE || hdr->content->type == TYPEMULTIPART) 
  • protos.h

    r437 r456  
    8888BODY *mutt_read_mime_header (FILE *, int); 
    8989 
    90 ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *); 
     90ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short); 
    9191HEADER *mutt_dup_header (HEADER *); 
    9292 
  • sendlib.c

    r453 r456  
    10251025  body->hdr = mutt_new_header(); 
    10261026  body->hdr->offset = 0; 
    1027   body->hdr->env = mutt_read_rfc822_header(fp, body->hdr); 
     1027  /* we don't need the user headers here */ 
     1028  body->hdr->env = mutt_read_rfc822_header(fp, body->hdr, 0); 
    10281029#ifdef _PGPPATH 
    10291030  body->hdr->pgp = pgp;