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}
struct outqueuenode * head
__msvcrt_long CDECL ftell(FILE *file)
int CDECL fclose(FILE *file)
int CDECL fseek(FILE *file, __msvcrt_long offset, int whence)
size_t CDECL fread(void *ptr, size_t size, size_t nmemb, FILE *file)
FILE *CDECL fopen(const char *path, const char *mode)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP char *__cdecl strstr(const char *, const char *)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
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,...)