Subj : MsgBase.put_msg_header() failing to save header
To   : Nightfox
From : Digital Man
Date : Mon Aug 15 2016 09:14 pm

 Re: MsgBase.put_msg_header() failing to save header
 By: Nightfox to Digital Man on Mon Aug 15 2016 08:08 pm

>   Re: MsgBase.put_msg_header() failing to save header
>   By: Digital Man to Nightfox on Wed Aug 10 2016 22:00:02
>
>  > >>> Why might put_msg_header() fail?
>
>  > DM>> For a number of reasons. Try printing the msgbase.status and
>  > DM>> msgbase.error values when whever put_msg_header() fails along with
>  > DM>> the parameter values you're passing to put_msg_header(), and then
>  > DM>> share the results here. That'll help to isolate the cause of the
>  > DM>> error.
>
>  >> This is the status and error message I'm getting when it fails to save
>  >> the message:
>  >> Status: -101
>  >> Error: illegal header length increase: 770 (4 blocks) vs 752 (3
>  >> blocks)
>
>  DM> This means that the modified message header requires more storage
>  DM> (blocks in the *.shd file) than what was allocated for the original
>  DM> message header. The read header used 752 bytes (3 256-byte blocks) and
>  DM> the modified header requires 770 bytes (4 256-byte blocks). Setting the
>  DM> "read" attribute should not increase the storage space for a header at
>  DM> all, so something else is changing between when you read the header and
>  DM> when you're attempting to write it.
>
> My reader script shouldn't do anything that increases the size of the header
> before I write it.

If you don't pass 'false' as the 3rd argument to MsgBase.get_msg_header(), some
header fields are expanded (e.g. missing message-IDs created) and some header
fields which are non-existent or blank in the SMB are created in the JS
instance of the header. So like the JS object model doc says:
       "Pass false for the expand_fields argument (default: true) if you will
        be re-writing the header later with put_msg_header()"

                                           digital man

Synchronet/BBS Terminology Definition #5:
BinkD = Binkley Daemon
Norco, CA WX: 83.2�F, 28.0% humidity, 4 mph SE wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net