Disconnect the HTTP connection on unrecoverable error
[deb_shairplay.git] / src / lib / httpd.c
index 757f05064ae49b9cb14b9b95cbc3c2e86487d7c0..1d9e7e2eb454334efec4f6e7ba106a7f9c9104a7 100644 (file)
@@ -304,6 +304,11 @@ httpd_thread(void *arg)
                                                }
                                                written += ret;
                                        }
+
+                                       if (http_response_get_disconnect(response)) {
+                                               logger_log(httpd->logger, LOGGER_INFO, "Disconnecting on software request");
+                                               httpd_remove_connection(httpd, connection);
+                                       }
                                } else {
                                        logger_log(httpd->logger, LOGGER_INFO, "Didn't get response");
                                }