diff options
Diffstat (limited to 'src/http.cc')
-rw-r--r-- | src/http.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/http.cc b/src/http.cc index fe37d76..8aa83c3 100644 --- a/src/http.cc +++ b/src/http.cc @@ -30,6 +30,8 @@ #include <stdio.h> #include <string.h> +#include "hugin.hpp" + int callback_http(struct libwebsocket_context * context, struct libwebsocket *wsi, enum libwebsocket_callback_reasons reason, void *user, @@ -40,14 +42,14 @@ int callback_http(struct libwebsocket_context * context, switch(reason) { case LWS_CALLBACK_HTTP: - fprintf(stderr, "serving HTTP URI %s\n", (char *)in); + DEBUG(httpd,"serving HTTP URI %s\n", (char *)in); // // add favicon later if(in && strcmp((const char *)in, "/favicon.ico") == 0) { if(libwebsockets_serve_http_file(wsi, LOCAL_RESOURCE_PATH"/favicon.ico", "image/x-icon")) - fprintf(stderr, "Failed to send favicon\n"); + DEBUG(httpd,"Failed to send favicon\n"); break; } @@ -56,7 +58,7 @@ int callback_http(struct libwebsocket_context * context, if(libwebsockets_serve_http_file(wsi, LOCAL_RESOURCE_PATH"/proto.js", "text/javascript")) - fprintf(stderr, "Failed to send javascript\n"); + DEBUG(httpd,"Failed to send javascript\n"); break; } @@ -65,7 +67,7 @@ int callback_http(struct libwebsocket_context * context, if(libwebsockets_serve_http_file(wsi, LOCAL_RESOURCE_PATH"/munia.html", "text/html")) - fprintf(stderr, "Failed to send HTTP file\n"); + DEBUG(httpd,"Failed to send HTTP file\n"); break; /* @@ -82,8 +84,8 @@ int callback_http(struct libwebsocket_context * context, sizeof(client_name), client_ip, sizeof(client_ip)); - fprintf(stderr, "Received network connect from %s (%s)\n", - client_name, client_ip); + DEBUG(httpd,"Received network connect from %s (%s)\n", + client_name, client_ip); /* if we returned non-zero from here, we kill the connection */ break; |