+#include "formdata.h"
#include <msp/core/maputils.h>
#include "header.h"
#include "request.h"
#include "submessage.h"
#include "utils.h"
-#include "formdata.h"
using namespace std;
if(is_boundary)
{
- /* The CRLF preceding the boundary delimiter is treated as part
- of the delimiter as per RFC 2046 */
- string::size_type part_end = line_start-1;
- if(content[part_end-1]=='\r')
- --part_end;
-
if(part_start>0)
{
- SubMessage part = SubMessage::parse(content.substr(part_start, line_start-part_start));
+ /* The CRLF preceding the boundary delimiter is treated as part
+ of the delimiter as per RFC 2046 */
+ string::size_type part_end = line_start-1;
+ if(content[part_end-1]=='\r')
+ --part_end;
+
+ SubMessage part = SubMessage::parse(content.substr(part_start, part_end-part_start));
Header content_disposition(part, "Content-Disposition");
const Header::Value &cd_value = content_disposition.values.at(0);
if(cd_value.value=="form-data")
}
part_start = lf+1;
- }
- if(!content.compare(line_start+2+boundary.size(), 2, "--"))
- break;
+ if(!content.compare(line_start+2+boundary.size(), 2, "--"))
+ break;
+ }
line_start = lf+1;
}
const string &FormData::get_value(const string &key) const
{
- map<string, string>::const_iterator i = fields.find(key);
+ auto i = fields.find(key);
if(i==fields.end())
{
static string dummy;