You are right again. I can't rely on that test.
This is why i received partial body on Windows.
On Linux the flag "MSG_WAITALL" is available, but this does not seem a reliable solution.
So this turned out to be a problem with the socket API, and has nothing to do with fwrite.
I've tried to increase the receive socket buffer size with "setsockopt", but i still receive partial body....
You were right, i get access violation trying to do "puts(parsed_request->body+100000);".
So now i have to recheck all the program logic that fills the buffer...
You are right about that.
But i expected that even if there was a mismatch between the buffer size and the "content_length" value the write operation should at least start and then throw an error,...
Well, i think that if the whole thing works ok on linux (no segm.faults thrown and the file is written correctly), then the logic must be correct (body buffer must be of the correct size).
Dont you...
Yes i've thinked of it too, but the test case i've used for testing is build so that the content_length matches exactly the length of the body buffer.
So you can assume that this condition is always...
Boy, it's just what i've posted:
If fwrite succeed errno remains 0 and perror outputs "No error",
otherwise errno!=0 and perror output something meaningful.
No, perror always output "Invalid Argument" (that is, errno 22).
I've also disabled multi-threading so there can't be any interference with other threads...
I already tried that. Still get ERRNO==22. :-(
BTW, the correct way should be the first one. See http://www.opengroup.org/onlinepubs/009695399/functions/fwrite.html):
I mean to write...
I have the same problem when I open dialog with WebBrowser control in it. The dialog is NOT in another thread. I don't know is this a very correct sollution, but I solved it with this code in the...
Hi there,
most important information first:
* Paid: No
* Type: Very Small Program (I guess less than 15 minutes for an experienced programmer)
* Requirements: Should run on Windows...
Boy, you are right!
Maybe i've made confusion between Java and C++ having studied both in the same time.
If only the compiler had warned me about constructor chaining...
Hello everybody, since last year i've been developing an SDL-based library for videogames,
but lately i'm stuck on a problem that concerns (i think) inheritance and copy costructors/assignment...