this post was submitted on 02 Jan 2026
92 points (98.9% liked)
Programming
24348 readers
235 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I worked at an IoT platform startup. All of our embedded device demos stopped working August 1st. I was told the same thing happened last year, but it was fine, things would start working in September. I decided to go fix it anyway. Eventually I figured out the culprit was a custom HTTP library. Instead of doing anything sensible, the way it found the Content-Length header was to loop over the bytes of the response until it found the first 'g' add 5 to that pointer and then assume that whatever was there was the number of bytes it should read. Unfortunately, HTTP responses have a Date header which includes the month and August has a 'g' in it.
There were a bunch of these demo devices already flashed and shipped out. The 'fix' to get them to work, even in August, was to downgrade requests to HTTP 0.9 which didn't require a Date header in the response.
That's "I wrote my first shell script" type of bad. I remember Ubuntu+GNOME used to be full of such crap in their early days. There are still some helper scripts around from those days (the naughts), you can still catch a whiff of it.
Is there any reason they couldn't just look for the complete "Content-length" string?
Yeah, to be fair, there was an issue getting
string.hto work (so i could just usestrstr) with the vendor's shitty toolchain, that took me talking to an engineer at the vendor, and the dev who wrote that was out of our Taiwan office. But also, my first fix was just doing a sort of sliding-window check, manually checing fors[0] == '\n' && s[1] == 'C' && s[2] == 'o' &&..., which was gross, but much more correct.Wait...not being able to use a basic library like string.h opens up so many other questions
🤷, embedded device manufacturers were really bad at software back then. I honestly don't remember the details anymore.
The only words I don't believe there are... Were and back then