Timeline for Images Not Loading in Server.c, but Getting 200 OK Response
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 18, 2016 at 16:58 | comment | added | Nicholas S | Wow it works perfectly now! Thanks so much! :) | |
May 18, 2016 at 16:57 | vote | accept | Nicholas S | ||
May 18, 2016 at 16:42 | comment | added | DinoCoderSaurus | I think it's the strncpy. Answer has been update. | |
May 18, 2016 at 16:41 | history | edited | DinoCoderSaurus | CC BY-SA 3.0 |
change my answer, which is my prerogative :)
|
May 18, 2016 at 16:27 | comment | added | Nicholas S | Hmmmm that's an idea. Also just noticed that load works for php code when called by "interpret". It's only failing for images...could that be a clue to the bug? | |
May 18, 2016 at 15:13 | comment | added | DinoCoderSaurus | 26860 is the right size for cat.jpg. I've never seen incomplete sequence, it's troubling. The theory I'm looking at now is: a black pixel will be three 0 bytes. The first of which would look like a null-terminator in a string. strncpy will only copy buffer until the first null. memcpy may be a better choice (to eliminate the string "thing"), since content is not a string. Just a theory right now, repro continues......... | |
May 18, 2016 at 15:04 | comment | added | Nicholas S | So going through it with GDB, the value of count at the end of that execution is 26860 and if I try to print the value of buffer it says "0x607ab0 "\377\330\377", <incomplete sequence \340>". I'm assuming this is because it can't actually print something that long. | |
May 18, 2016 at 14:44 | comment | added | DinoCoderSaurus | Sorry about that, I don't think I had that right...reviewing again. | |
May 18, 2016 at 14:44 | comment | added | Nicholas S | and then did *length = count; | |
May 18, 2016 at 14:43 | comment | added | Nicholas S | after that loop completed I said count = count -1; | |
May 18, 2016 at 14:14 | comment | added | Nicholas S | Nope that didn't solve it. Actually made it fail a bunch of the other check50's where it was succeeding earlier. Could it be that I'm reading in chars when I need to be reading in something else. I tried to go through it will GDB but couldn't really see why it wasn't working :/ | |
May 18, 2016 at 13:59 | comment | added | Nicholas S | Hmmmmm I will check that out. Also updated the title. I was originally going to ask that, but then solved it midway through typing my issue. | |
May 17, 2016 at 19:19 | history | answered | DinoCoderSaurus | CC BY-SA 3.0 |