106{
109#define BUFLEN 8192
111 size_t bytes_read,
total, filesize;
114
115
116#define SEP "--8<--cut-here--8<--"
117 static const char head[] =
"POST /submit HTTP/1.0\r\n"
118 "Host: test.winehq.org\r\n"
119 "User-Agent: Winetest Shell\r\n"
120 "Content-Type: multipart/form-data; boundary=\"" SEP "\"\r\n"
121 "Content-Length: %u\r\n\r\n";
122 static const char body1[] =
"--" SEP "\r\n"
123 "Content-Disposition: form-data; name=\"reportfile\"; filename=\"%s\"\r\n"
124 "Content-Type: application/octet-stream\r\n\r\n";
125 static const char body2[] =
"\r\n--" SEP "\r\n"
126 "Content-Disposition: form-data; name=\"submit\"\r\n\r\n"
127 "Upload File\r\n"
129
132
136 goto abort1;
137 }
140 if (filesize > 1.5*1024*1024) {
142 "File too big (%.1f MB > 1.5 MB); submitting partial report.",
143 filesize/1024.0/1024);
144 filesize = 1.5*1024*1024;
145 }
147
156 goto abort2;
157 }
158
163 if ((signed)bytes_read == -1) {
165 goto abort2;
166 }
168 if (
total > filesize) bytes_read -=
total - filesize;
172 goto abort2;
173 }
174 report (
R_DELTA, bytes_read,
"Network transfer: In progress");
175 }
177
178 if (
send_buf (
s, body2,
sizeof body2 - 1)) {
181 goto abort1;
182 }
184
190 goto abort1;
191 }
195 goto abort1;
196 }
197 }
201 return 1;
202 }
203
204 str =
strmake (&bytes_read,
"Received %s (%d bytes).\n",
214 "Server response: %s",
name,
str);
215 }
217
218 abort2:
220 abort1:
222 return 1;
223}
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
struct outqueuenode * head
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
static int send_buf(SOCKET s, const char *buf, size_t length)
static int send_str(SOCKET s,...)
static int close_http(SOCKET s)
static SOCKET open_http(const char *server)
char * strmake(size_t *lenp,...)