Merge pull request #15731 from unknownbrackets/reporting-crash

Reporting: Avoid crash if socket connect fails
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-07-27 07:43:30 +02:00
commit fc70d21d04
1 file changed
+5 -3
+5 -3
View File
@@ -280,9 +280,11 @@ namespace Reporting
return false;
if (http.Resolve(serverHost, ServerPort())) {
http.Connect();
int result = http.POST(http::RequestParams(uri), data, mimeType, output, &progress);
http.Disconnect();
int result = -1;
if (http.Connect()) {
result = http.POST(http::RequestParams(uri), data, mimeType, output, &progress);
http.Disconnect();
}
return result >= 200 && result < 300;
} else {