HylaFAX The world's most advanced open source fax server |
* Bodo Meissner <bodo@xxxxxxxxx> [051123 11:41]: > Hello Aidan, > > sure it's an improvement, but IMHO this is only a theroretical problem. > It will be hard to measure faster processing or shorter CPU time with > the removed mod operation and the maximum number 999999999 instead of > 999999998 is only cosmetic. Right. > My HylaFAX server probably will never wrap around, so I won't see these > messages in my logfiles. ;-) We've seen some getting in the millions, but it's taking a long time to get there... Rolling over doesn't look like it's happening in the near future... > >A possible enhancement is a "wrapping" warning message instead of the > >current "Invalid sequence number..." warning message. > > The intention of the original message looks seems to be to inform about > invalid content in the sequence file. (The check could be improved by > using strtol instead of atoi and checking the end-pointer.) Right. It could write 0 to seqf on the roll, which would cause the message. I think it's better to message on the rollover and write a "good" sequence to seqf. > I think two separate warning messages would be better. > > Maybe something like this: > > > if (seqnum < 1 || seqnum > MAXSEQNUM) { > if(seqnum == MAXSEQNUM+1) { > logWarning("%s: Maximum sequence number reached, starting > with 1 again", > name); > } else { > logWarning("%s: Invalid sequence number \"%s\", resetting > to 1" > name, line); > } > } OK - I'll have a go at some better checks/messages on this stuff. a. -- Aidan Van Dyk aidan@xxxxxxxx Senior Software Developer +1 215 438-4638 x8103 iFAX Solutions, Inc. http://www.ifax.com/
Attachment:
signature.asc
Description: Digital signature