Add more debugging information to httpd.c
[deb_shairplay.git] / src / lib / httpd.c
index 88971faa5f57451b22d58a1959da108bd9229e68..0f82b261fe34c12e81717fb447acaa33f4170dcb 100644 (file)
@@ -311,6 +311,8 @@ httpd_thread(void *arg)
                                        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...");
                        }
                }
        }
@@ -326,6 +328,16 @@ httpd_thread(void *arg)
                httpd_remove_connection(httpd, connection);
        }
 
+       /* Close server sockets since they are not used any more */
+       if (httpd->server_fd4 != -1) {
+               closesocket(httpd->server_fd4);
+               httpd->server_fd4 = -1;
+       }
+       if (httpd->server_fd6 != -1) {
+               closesocket(httpd->server_fd6);
+               httpd->server_fd6 = -1;
+       }
+
        logger_log(httpd->logger, LOGGER_INFO, "Exiting HTTP thread");
 
        return 0;