From adab7fc5a061624ad931fee4f95de09f78ace91d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 11 Jan 2013 15:52:08 +0100 Subject: Fix unobserve bug. Change more printf's into hugin syntax. --- src/http.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/http.cc') 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 #include +#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; -- cgit v1.2.3