Net: near complete merge to 1.4.2

This commit is contained in:
Marian Krivos
2011-09-14 18:20:11 +00:00
parent 56c6a4f758
commit b242f2c8d1
192 changed files with 15545 additions and 2277 deletions

View File

@@ -126,13 +126,15 @@ void HTMLFormTest::testWriteMultipart()
form.set("field1", "value1");
form.set("field2", "value 2");
form.set("field3", "value=3");
form.set("field4", "value&4");
form.addPart("attachment1", new StringPartSource("This is an attachment"));
form.addPart("attachment2", new StringPartSource("This is another attachment", "text/plain", "att2.txt"));
std::ostringstream ostr;
form.write(ostr, "MIME_boundary_0123456789");
form.set("field4", "value&4");
form.addPart("attachment1", new StringPartSource("This is an attachment"));
StringPartSource* pSPS = new StringPartSource("This is another attachment", "text/plain", "att2.txt");
pSPS->headers().set("Content-ID", "1234abcd");
form.addPart("attachment2", pSPS);
std::ostringstream ostr;
form.write(ostr, "MIME_boundary_0123456789");
std::string s = ostr.str();
assert (s ==
"--MIME_boundary_0123456789\r\n"
@@ -149,18 +151,19 @@ void HTMLFormTest::testWriteMultipart()
"value=3\r\n"
"--MIME_boundary_0123456789\r\n"
"Content-Disposition: form-data; name=\"field4\"\r\n"
"\r\n"
"value&4\r\n"
"--MIME_boundary_0123456789\r\n"
"Content-Disposition: file; name=\"attachment1\"\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"This is an attachment\r\n"
"--MIME_boundary_0123456789\r\n"
"Content-Disposition: file; name=\"attachment2\"; filename=\"att2.txt\"\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"This is another attachment\r\n"
"\r\n"
"value&4\r\n"
"--MIME_boundary_0123456789\r\n"
"Content-Disposition: form-data; name=\"attachment1\"\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"This is an attachment\r\n"
"--MIME_boundary_0123456789\r\n"
"Content-Disposition: form-data; name=\"attachment2\"; filename=\"att2.txt\"\r\n"
"Content-ID: 1234abcd\r\n"
"Content-Type: text/plain\r\n"
"\r\n"
"This is another attachment\r\n"
"--MIME_boundary_0123456789--\r\n"
);
}