-
MsgBase.put_msg_header() failing to save header
From
Nightfox@VERT/DIGDIST to
All on Tue Aug 9 21:05:02 2016
I have a message reader script for Synchronet that I've written in JavaScript. ãI've written it so that when the user reads a message that was written to them,ãit will mark the message as read (by setting the MSG_READ attribute). I'mãusing the put_msg_header() function to save a header with that attribute, andãit seems there are some cases where put_msg_header() fails to save the header.ãI am checking to ensure the message was written to the user, so I don't thinkãthat would be the issue.. I did notice that one area where saving the headerãis failing is a FidoNet area - I'm not sure if that matters though.ããThis is how I enable the read attribute (msgHeader is the message headerãobject):ããmsgHeader.attr |= MSG_READ;ããI've tried calling put_msg_header a few different ways, using the messageãnumber vs. message offset:ããmsgbase.put_msg_header(true, msgHeader.offset, msgHeader);ãmsgbase.put_msg_header(false, msgHeader.number, msgHeader);ãmsgbase.put_msg_header(msgHeader.number, msgHeader);ããI tried the 3rd one since the first parameter is optional (according to theãSynchronet JS docs); I've also seen examples that omit the first parameter andãjust use the message number. Where it fails, I will exit my message reader andãthen read message again, and it thinks the message has not been read. I'veãalso seen put_msg_header() return false in that case.ããWhy might put_msg_header() fail?ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Wed Aug 10 01:12:10 2016
Re: MsgBase.put_msg_header() failing to save headerã By: Nightfox to All on Tue Aug 09 2016 09:05 pmãã > I have a message reader script for Synchronet that I've written inã > JavaScript. I've written it so that when the user reads a message that wasã > written to them, it will mark the message as read (by setting the MSG_READã > attribute). I'm using the put_msg_header() function to save a header withã > that attribute, and it seems there are some cases where put_msg_header()ã > fails to save the header. I am checking to ensure the message was written toã > the user, so I don't think that would be the issue.. I did notice that oneã > area where saving the header is failing is a FidoNet area - I'm not sure ifã > that matters though.ã >ã > This is how I enable the read attribute (msgHeader is the message headerã > object):ã >ã > msgHeader.attr |= MSG_READ;ã >ã > I've tried calling put_msg_header a few different ways, using the messageã > number vs. message offset:ã >ã > msgbase.put_msg_header(true, msgHeader.offset, msgHeader);ã > msgbase.put_msg_header(false, msgHeader.number, msgHeader);ã > msgbase.put_msg_header(msgHeader.number, msgHeader);ããAll 3 of those syntaxes should work, assuming the parameters are correct.ãã > I tried the 3rd one since the first parameter is optional (according to theã > Synchronet JS docs); I've also seen examples that omit the first parameterã > and just use the message number. Where it fails, I will exit my messageã > reader and then read message again, and it thinks the message has not beenã > read. I've also seen put_msg_header() return false in that case.ã >ã > Why might put_msg_header() fail?ããFor a number of reasons. Try printing the msgbase.status and msgbase.errorãvalues when whever put_msg_header() fails along with the parameter valuesãyou're passing to put_msg_header(), and then share the results here. That'llãhelp to isolate the cause of the error.ãã digital manããSynchronet/BBS Terminology Definition #1:ãANSI = American National Standards InstituteãNorco, CA WX: 63.5øF, 89.0% humidity, 1 mph SE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Wed Aug 10 19:17:42 2016
Re: MsgBase.put_msg_header() failing to save headerã By: Digital Man to Nightfox on Wed Aug 10 2016 01:12:10ãã >> Why might put_msg_header() fail?ãã DM> For a number of reasons. Try printing the msgbase.status and msgbase.errorã DM> values when whever put_msg_header() fails along with the parameter valuesã DM> you're passing to put_msg_header(), and then share the results here.ã DM> That'll help to isolate the cause of the 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)ããI get the same error whether I use the message number or offset. Theãparameters I'm passing to msgbase.put_msg_header are false, 2289, and theãheader object containing these values:ãattr: 0ãto: Eric Oulashinãfrom: robert wolfeãoffset: 730ãwhen_written_time: 1465744314ãwhen_written_zone_offset: -300ãwhen_imported_zone_offset: -480ãauxattr: 0ãnetattr: 0ãsubject: BBS software for Mac OS Xãid: <
575D6BE8.2289.fido_bbscarni@digitaldistortionbbs.com>ãreply_id: <
57559F2C.2255.fido_bbscarni@digitaldistortionbbs.com>ãfrom_net_addr: 1:116/17ãnumber: 2289ãto_net_type: 0ãto_agent: 0ãfrom_net_type: 2ãfrom_agent: 0ãreplyto_net_type: 0ãreplyto_agent: 0ãftn_msgid: 1:116/17 48cc417bãftn_reply: 2255.fido_bbscarni@1:340/7 1bbaddfbãftn_area: BBS_CARNIVALãftn_tid: Mystic BBS 1.12 A16ãdate: Sun, 12 Jun 2016 08:11:54 -0500ãwhen_written_zone: 16684ãwhen_imported_time: 1465740264ãwhen_imported_zone: 16864ãthread_id: 2239ãthread_next: 0ãthread_first: 0ãfield_list: [object Object],[object Object],[object Object],[object ãObject],[object Object],[object Object]ãforwarded: 0ãexpiration: 0ãpriority: 0ãcost: 0ãtype: 0ãversion: 289ãthread_back: 2255ãdelivery_attempts: 0ãlast_downloaded: 0ãtimes_downloaded: 0ãdata_length: 582ãcan_read: trueãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Wed Aug 10 22:00:02 2016
Re: MsgBase.put_msg_header() failing to save headerã By: Nightfox to Digital Man on Wed Aug 10 2016 07:17 pmãã > Re: MsgBase.put_msg_header() failing to save headerã > By: Digital Man to Nightfox on Wed Aug 10 2016 01:12:10ã >ã > >> 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 theã > DM> parameter values you're passing to put_msg_header(), and then share theã > DM> results here. That'll help to isolate the cause of the 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)ããThis means that the modified message header requires more storage (blocks inãthe *.shd file) than what was allocated for the original message header. Theãread header used 752 bytes (3 256-byte blocks) and the modified header requiresã770 bytes (4 256-byte blocks). Setting the "read" attribute should not increaseãthe storage space for a header at all, so something else is changing betweenãwhen you read the header and when you're attempting to write it.ãã > I get the same error whether I use the message number or offset. Theã > parameters I'm passing to msgbase.put_msg_header are false, 2289, and theã > header object containing these values:ã > attr: 0ã > to: Eric Oulashinã > from: robert wolfeã > offset: 730ã > when_written_time: 1465744314ã > when_written_zone_offset: -300ã > when_imported_zone_offset: -480ã > auxattr: 0ã > netattr: 0ã > subject: BBS software for Mac OS Xã > id: <
575D6BE8.2289.fido_bbscarni@digitaldistortionbbs.com>ã > reply_id: <
57559F2C.2255.fido_bbscarni@digitaldistortionbbs.com>ã > from_net_addr: 1:116/17ã > number: 2289ã > to_net_type: 0ã > to_agent: 0ã > from_net_type: 2ã > from_agent: 0ã > replyto_net_type: 0ã > replyto_agent: 0ã > ftn_msgid: 1:116/17 48cc417bã > ftn_reply: 2255.fido_bbscarni@1:340/7 1bbaddfbã > ftn_area: BBS_CARNIVALã > ftn_tid: Mystic BBS 1.12 A16ã > date: Sun, 12 Jun 2016 08:11:54 -0500ã > when_written_zone: 16684ã > when_imported_time: 1465740264ã > when_imported_zone: 16864ã > thread_id: 2239ã > thread_next: 0ã > thread_first: 0ã > field_list: [object Object],[object Object],[object Object],[objectã > Object],[object Object],[object Object]ããThe problem might lie in this field_list. Can you expand this array in yourãdebug output so we can see what's being added to the header?ããAlso, the dump of the original header would be useful for comparison purposes.ãã digital manããSynchronet "Real Fact" #78:ãSynchronet Match Maker had at one time over 4000 profiles of men and women.ãNorco, CA WX: 67.3øF, 77.0% humidity, 4 mph SE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Mon Aug 15 20:08:38 2016
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 (blocksã DM> in the *.shd file) than what was allocated for the original messageã DM> header. The read header used 752 bytes (3 256-byte blocks) and theã DM> modified header requires 770 bytes (4 256-byte blocks). Setting the "read"ã DM> attribute should not increase the storage space for a header at all, soã DM> something else is changing between when you read the header and whenã DM> you're attempting to write it. ããMy reader script shouldn't do anything that increases the size of the headerãbefore I write it. I can double-check my reader to see if it's doing anythingãto increase the header size though. The odd thing is that it successfullyãsaves the header for some messages but fails this way for others.ãã DM> The problem might lie in this field_list. Can you expand this array inã DM> your debug output so we can see what's being added to the header?ãã DM> Also, the dump of the original header would be useful for comparisonã DM> purposes. ããI've updated the debug dump to expand field_list.ãThis is the original header before my reader modifies it:ããnumber: 2289ãoffset: 727ãto: Eric Oulashinãfrom: robert wolfeãsubject: BBS software for Mac OS Xãto_agent: 0ãfrom_agent: 0ãreplyto_agent: 0ãto_net_type: 0ãfrom_net_type: 2ãfrom_net_addr: 1:116/17ãreplyto_net_type: 0ãforwarded: 0ãexpiration: 0ãpriority: 0ãcost: 0ãtype: 0ãversion: 289ãattr: 0ãauxattr: 0ãnetattr: 0ãwhen_written_time: 1465744314ãwhen_written_zone: 16684ãwhen_written_zone_offset: -300ãwhen_imported_time: 1465740264ãwhen_imported_zone: 16864ãwhen_imported_zone_offset: -480ãthread_id: 2239ãthread_back: 2255ãthread_next: 0ãthread_first: 0ãdelivery_attempts: 0ãlast_downloaded: 0ãtimes_downloaded: 0ãdata_length: 582ãdate: Sun, 12 Jun 2016 08:11:54 -0500ãreply_id: <
57559F2C.2255.fido_bbscarni@digitaldistortionbbs.com>ãid: <
575D6BE8.2289.fido_bbscarni@digitaldistortionbbs.com>ãftn_msgid: 1:116/17 48cc417bãftn_reply: 2255.fido_bbscarni@1:340/7 1bbaddfbãftn_tid: Mystic BBS 1.12 A16ãftn_area: BBS_CARNIVALãfield_list:ã 0:ã type: 162ã data: 14/5 18/200 19/33 34/999 90/1 116/17 18 110 120/331 123/10 500ã 1:ã type: 162ã data: 128/187 140/1 218/510 700 222/2 230/150 240/1120 249/303 261/20 38ã 2:ã type: 162ã data: 261/100 266/404 267/155 280/1027 282/1056 292/907 908 320/119 219ã 3:ã type: 162ã data: 340/400 393/68 73 396/45 712/848 801/161 189 2320/105 303 340/7 10ã 4:ã type: 162ã data: 340/100 138/389 340/700 226/50 340/200 101 800 300/6 5 340/0ã 5:ã type: 163ã data: 116/17 18 261/38 340/400ãcan_read: trueãããAnd this is the header after it applies the MSG_READ attribute:ããnumber: 2289ãoffset: 727ãto: Eric Oulashinãfrom: robert wolfeãsubject: BBS software for Mac OS Xãto_agent: 0ãfrom_agent: 0ãreplyto_agent: 0ãto_net_type: 0ãfrom_net_type: 2ãfrom_net_addr: 1:116/17ãreplyto_net_type: 0ãforwarded: 0ãexpiration: 0ãpriority: 0ãcost: 0ãtype: 0ãversion: 289ãattr: 2ãauxattr: 0ãnetattr: 0ãwhen_written_time: 1465744314ãwhen_written_zone: 16684ãwhen_written_zone_offset: -300ãwhen_imported_time: 1465740264ãwhen_imported_zone: 16864ãwhen_imported_zone_offset: -480ãthread_id: 2239ãthread_back: 2255ãthread_next: 0ãthread_first: 0ãdelivery_attempts: 0ãlast_downloaded: 0ãtimes_downloaded: 0ãdata_length: 582ãdate: Sun, 12 Jun 2016 08:11:54 -0500ãreply_id: <
57559F2C.2255.fido_bbscarni@digitaldistortionbbs.com>ãid: <
575D6BE8.2289.fido_bbscarni@digitaldistortionbbs.com>ãftn_msgid: 1:116/17 48cc417bãftn_reply: 2255.fido_bbscarni@1:340/7 1bbaddfbãftn_tid: Mystic BBS 1.12 A16ãftn_area: BBS_CARNIVALãfield_list:ã 0:ã type: 162ã data: 14/5 18/200 19/33 34/999 90/1 116/17 18 110 120/331 123/10 500ã 1:ã type: 162ã data: 128/187 140/1 218/510 700 222/2 230/150 240/1120 249/303 261/20 38ã 2:ã type: 162ã data: 261/100 266/404 267/155 280/1027 282/1056 292/907 908 320/119 219ã 3:ã type: 162ã data: 340/400 393/68 73 396/45 712/848 801/161 189 2320/105 303 340/7 10ã 4:ã type: 162ã data: 340/100 138/389 340/700 226/50 340/200 101 800 300/6 5 340/0ã 5:ã type: 163ã data: 116/17 18 261/38 340/400ãcan_read: trueããããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Mon Aug 15 21:14:17 2016
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 þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Tue Aug 16 19:47:37 2016
Re: MsgBase.put_msg_header() failing to save headerã By: Digital Man to Nightfox on Mon Aug 15 2016 21:14:17ãã DM> If you don't pass 'false' as the 3rd argument to MsgBase.get_msg_header(),ã DM> some header fields are expanded (e.g. missing message-IDs created) andã DM> some header fields which are non-existent or blank in the SMB are createdã DM> in the JS instance of the header. So like the JS object model doc says:ã DM> "Pass false for the expand_fields argument (default: true) if you willã DM> be re-writing the header later with put_msg_header()"ããAh, I must have forgotten that note in the JS object model doc. That's whatãwas causing put_msg_header to fail in my reader. Thanks.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Wed Aug 17 14:07:21 2016
Re: MsgBase.put_msg_header() failing to save headerã By: Nightfox to Digital Man on Tue Aug 16 2016 07:47 pmãã > Re: MsgBase.put_msg_header() failing to save headerã > By: Digital Man to Nightfox on Mon Aug 15 2016 21:14:17ã >ã > DM> If you don't pass 'false' as the 3rd argument toã > DM> MsgBase.get_msg_header(), some header fields are expanded (e.g. missingã > DM> message-IDs created) and some header fields which are non-existent orã > DM> blank in the SMB are created in the JS instance of the header. So likeã > DM> the JS object model doc says: "Pass false for the expand_fieldsã > DM> argument (default: true) if you willã > DM> be re-writing the header later with put_msg_header()"ã >ã > Ah, I must have forgotten that note in the JS object model doc. That's whatã > was causing put_msg_header to fail in my reader. Thanks.ããOkay, glad that's resolved. :-)ãã digital manããSynchronet/BBS Terminology Definition #43:ãXOFF = Transmit Off (ASCII 19, Ctrl-S)ãNorco, CA WX: 94.8øF, 21.0% humidity, 8 mph ESE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã