X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=httpinput.cpp;h=354e4b9885aa0d9be0622c4f85d1ec23e67be5d4;hp=012f5bc0c4f15d2a4da0f425034a7c82a50ff763;hb=ce95fbe3011d2e5be2da737b05bca9af8db8a646;hpb=742f56c25bdd54dc438b21cb5e422de520bc7231 diff --git a/httpinput.cpp b/httpinput.cpp index 012f5bc..354e4b9 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -57,6 +57,18 @@ HTTPInput::HTTPInput(const InputProto &serialized) parse_url(url, &protocol, &host, &port, &path); // Don't care if it fails. } +void HTTPInput::close_socket() +{ + int ret; + do { + ret = close(sock); + } while (ret == -1 && errno == EINTR); + + if (ret == -1) { + perror("close()"); + } +} + InputProto HTTPInput::serialize() const { InputProto serialized; @@ -215,6 +227,7 @@ void HTTPInput::do_work() request.clear(); request_bytes_sent = 0; response.clear(); + pending_data.clear(); { string protocol; // Thrown away.