Message Parsing
So, I have this 2nd job that I do in the evenings, at home. At the moment I'm implementing this fairly poorly documented binary protocol that is used for serializing data structures. I have an example message that I managed to tear out of the also-poorly-documented transport protocol, and it was yesterday that I made lots of progress in understanding how to parse the message. Until I got to the end of the message.
The message just ended with a 0x00 bye. That definitely did not fit the protocol as spec'ed. The spec could be wrong. Or incomplete. Either way, I had put in my time for the day, so I wrapped things up and went to bed.
As I was drifting off to sleep, it hit me: last week when I was working with the transport protocol, trying to extract the data segment (this message that I'm parsing), I recalled that the read buffer indicated that there were 326 bytes available while the message length claimed to be only 324. And that with two extra bytes on the message, if they turned out to be 0x0009, all of the sudden I'd have a valid message end.
I won't get to verify it until this evening, but I'm pretty sure that's what's going on. We'll see.
Now the real question is this: do I bill them for the time during which I was falling asleep and figured this out?