File diff r4320:c2a7d05512a6 → r4321:baa916e5dd65
win32.c
Show inline comments
 
@@ -256,25 +256,25 @@ static const char *SubmitCrashReport(HWN
 

	
 
	inet = _wininet.InternetOpen("OTTD", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
 
	if (inet == NULL) { err = "internetopen failed"; goto error1; }
 

	
 
	conn = _wininet.InternetConnect(inet, "openttd.com", INTERNET_DEFAULT_HTTP_PORT, "", "", INTERNET_SERVICE_HTTP, 0, 0);
 
	if (conn == NULL) { err = "internetconnect failed"; goto error2; }
 

	
 
	sprintf(buff, "/crash.php?file=%s&ident=%d", arg, _ident);
 

	
 
	http = _wininet.HttpOpenRequest(conn, "POST", buff, NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE , 0);
 
	if (http == NULL) { err = "httpopenrequest failed"; goto error3; }
 

	
 
	if (!_wininet.HttpSendRequest(http, "Content-type: application/binary", -1, msg, msglen)) { err = "httpsendrequest failed"; goto error4; }
 
	if (!_wininet.HttpSendRequest(http, "Content-type: application/binary", -1, msg, (DWORD)msglen)) { err = "httpsendrequest failed"; goto error4; }
 

	
 
	len = sizeof(code);
 
	if (!_wininet.HttpQueryInfo(http, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &code, &len, 0)) { err = "httpqueryinfo failed"; goto error4; }
 

	
 
	if (code != 200) {
 
		int l = sprintf(buf, "Server said: %d ", code);
 
		len = sizeof(buf) - l;
 
		_wininet.HttpQueryInfo(http, HTTP_QUERY_STATUS_TEXT, buf + l, &len, 0);
 
		err = buf;
 
	}
 

	
 
error4: