Re: [cgi-devel] post data with illegal characters
Status: Beta
Brought to you by:
drrngrvy
From: Darren G. <lis...@gm...> - 2010-11-02 13:15:41
|
Hi there, On 2 November 2010 12:38, <jc...@ol...> wrote: > Hello, > > Some of my POST variable are been added illegal characters at the end. > > 1986^@^@^@^@^@ > > insead of > 1986 > > to read those data I am using: > > for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > { > os << i->first << " = " << i->second << "\n"; > } > and > > req.post.pick("task","default"); > > with the illegal characters been added in both cases. > This looks like for some reason the buffer holding the input data is longer than it should be. I can't tell from this why that would be. Are you able to reproduce this using a complete test case that I can try compiling? A couple of questions to check: Q. Is the data being sent as multipart/form-data? Q. Does the post data buffer on the request have these extra characters too? You can get hold of the complete post data buffer by looking at request::post_data() - note that it is a vector<char> so you can't stream it to cout directly! Let me know how you get on. Cheers, Darren |