X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=httpinput.cpp;h=74466c7acbb671f33f4f0fa3a76c77091e324038;hp=68b91708e7b3059eeac08d3d62088daae2d90aa4;hb=94cd6d8799191a79fde828abfbc30cf9951c1cfc;hpb=9bb62cbda887f69e570a3ea0fd28b564c5adc2c9 diff --git a/httpinput.cpp b/httpinput.cpp index 68b9170..74466c7 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -76,8 +76,8 @@ HTTPInput::HTTPInput(const InputProto &serialized) pending_data.resize(serialized.pending_data().size()); memcpy(&pending_data[0], serialized.pending_data().data(), serialized.pending_data().size()); - string protocol; - parse_url(url, &protocol, &host, &port, &path); // Don't care if it fails. + string protocol, user; + parse_url(url, &protocol, &user, &host, &port, &path); // Don't care if it fails. pthread_mutex_init(&stats_mutex, NULL); stats.url = url; @@ -94,6 +94,7 @@ void HTTPInput::close_socket() { if (sock != -1) { safe_close(sock); + sock = -1; } MutexLock lock(&stats_mutex); @@ -339,8 +340,8 @@ void HTTPInput::do_work() } { - string protocol; // Thrown away. - if (!parse_url(url, &protocol, &host, &port, &path)) { + string protocol, user; // Thrown away. + if (!parse_url(url, &protocol, &user, &host, &port, &path)) { log(WARNING, "[%s] Failed to parse URL '%s'", url.c_str(), url.c_str()); break; } @@ -411,7 +412,7 @@ void HTTPInput::do_work() RequestParseStatus status = wait_for_double_newline(&response, buf, ret); if (status == RP_OUT_OF_SPACE) { - log(WARNING, "[%s] Sever sent overlong HTTP response!", url.c_str()); + log(WARNING, "[%s] Server sent overlong HTTP response!", url.c_str()); state = CLOSING_SOCKET; continue; } else if (status == RP_NOT_FINISHED_YET) {