Gordon Messmer wrote:
> 
> Sam Varshavchik wrote:
> 
> >
> > It's always safe to append more stuff to the control file.  Whether
> > it's safe to rewrite it from scratch is something I need to think about.
> 
> I thought it was, too.  However, when I started actually testing that
> theory, I found that it's not the case at the time that a courierfilter
> runs.  If a courierfilter appends data to a control file, Courier may
> then add a "COMCTLFILE_8BIT" record.  The write pointer for the ctlfile
> hasn't changed, so that record overwrites a portion of what data the
> courierfilter added.

submit2.C does not flush the control file before filtering.
As a workaround, to modify the control file I do something like

   fp = fopen(cfc->fname, "r+");
   fseek(fp, 0, SEEK_END);
   fprintf(fp, "%254s\n", "");

before adding "I" or "S" records as needed. I reckon about 32 bytes
per record is enough (possible records may be "U", "V", "w", "E", "p",
"W", and "A", in addition to "8".)


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to