fix possible bug in http_request

This commit is contained in:
darkrose 2015-12-20 18:37:57 +10:00
parent ea4666487e
commit 723cbe3504
1 changed files with 2 additions and 1 deletions

View File

@ -534,10 +534,11 @@ std::string http_request(char* host, char* url, char* post, int port)
HTTPResponseHeaders headers;
int s;
char buff[2048];
std::string h;
addr.setPort(port);
if (!host || !host[0]) {
std::string h = g_settings->get("api_server");
h = g_settings->get("api_server");
if (h == "")
return "";
host = (char*)h.c_str();