X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fhttpd.c;h=1d9e7e2eb454334efec4f6e7ba106a7f9c9104a7;hb=c5f6526802d1bf48635941f564552ef059dbc1f4;hp=dfd3d6b6a2a167587ef02e1d77e8cd23b16d695b;hpb=1321b5e9b11116f961b222a2e142701ff353e9cc;p=deb_shairplay.git diff --git a/src/lib/httpd.c b/src/lib/httpd.c index dfd3d6b..1d9e7e2 100644 --- a/src/lib/httpd.c +++ b/src/lib/httpd.c @@ -36,8 +36,6 @@ struct httpd_s { logger_t *logger; httpd_callbacks_t callbacks; - int use_rtsp; - int max_connections; int open_connections; http_connection_t *connections; @@ -54,7 +52,7 @@ struct httpd_s { }; httpd_t * -httpd_init(logger_t *logger, httpd_callbacks_t *callbacks, int max_connections, int use_rtsp) +httpd_init(logger_t *logger, httpd_callbacks_t *callbacks, int max_connections) { httpd_t *httpd; @@ -68,7 +66,6 @@ httpd_init(logger_t *logger, httpd_callbacks_t *callbacks, int max_connections, return NULL; } - httpd->use_rtsp = !!use_rtsp; httpd->max_connections = max_connections; httpd->connections = calloc(max_connections, sizeof(http_connection_t)); if (!httpd->connections) { @@ -260,7 +257,7 @@ httpd_thread(void *arg) /* If not in the middle of request, allocate one */ if (!connection->request) { - connection->request = http_request_init(httpd->use_rtsp); + connection->request = http_request_init(); assert(connection->request); } @@ -307,10 +304,17 @@ 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"); } http_response_destroy(response); + } else { + logger_log(httpd->logger, LOGGER_DEBUG, "Request not complete, waiting for more data..."); } } }