]> git.sesse.net Git - cubemap/blobdiff - httpinput.cpp
Support UDP input. Also fix some issues with socket closing.
[cubemap] / httpinput.cpp
index 46f1358927312ba210cfa2f518e29991595d14ed..354e4b9885aa0d9be0622c4f85d1ec23e67be5d4 100644 (file)
@@ -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;