winetest: Don't truncate oversize reports before sending them.

test.winehq.org already sets $CGI::POST_MAX to reject oversize reports.
Furthermore truncated reports are rejected anyway.
So avoid the code duplication and inconsistencies between the winetest
and test.winehq.org (or other site) size limits.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-10-28 12:42:59 +02:00 committed by Alexandre Julliard
parent 58efe0f43e
commit 99d36ccfb9
1 changed files with 2 additions and 15 deletions

View File

@ -162,15 +162,9 @@ send_file_direct (const char * url, const char *name)
report (R_WARNING, "Can't open file '%s': %u", name, GetLastError());
goto abort1;
}
filesize = GetFileSize( file, NULL );
if (filesize > 1.5*1024*1024) {
report (R_WARNING,
"File too big (%.1f MB > 1.5 MB); submitting partial report.",
filesize/1024.0/1024);
filesize = (DWORD) 1.5*1024*1024;
}
report (R_STATUS, "Sending header");
filesize = GetFileSize( file, NULL );
str = strmake (&total, body1, name);
ret = send_str (s, head, filesize + total + sizeof body2 - 1) ||
send_buf (s, str, total);
@ -339,14 +333,6 @@ send_file_wininet (const char *url, const char *name)
goto done;
}
filesize = GetFileSize( file, NULL );
if (filesize > 1.5*1024*1024) {
report (R_WARNING,
"File too big (%.1f MB > 1.5 MB); submitting partial report.",
filesize/1024.0/1024);
filesize = 1.5*1024*1024;
}
report (R_STATUS, "Opening %s connection to %s:%d",
(uc.nScheme == INTERNET_SCHEME_HTTP ? "http" : "https"),
uc.lpszHostName, uc.nPort);
@ -369,6 +355,7 @@ send_file_wininet (const char *url, const char *name)
}
report (R_STATUS, "Sending request");
filesize = GetFileSize( file, NULL );
str = strmake (&total, body1, name);
memset(&buffers_in, 0, sizeof(INTERNET_BUFFERSA));
buffers_in.dwStructSize = sizeof(INTERNET_BUFFERSA);