/*
- Copyright (C) 2010-2011 jeanfi@gmail.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA
-*/
+ * Copyright (C) 2010-2011 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
#include <locale.h>
#include <libintl.h>
#define _(str) gettext(str)
#endif
#include "psensor_json.h"
-#include "plib/url.h"
-#include "plib/plib_io.h"
+#include "url.h"
+#include "p_io.h"
#include "server.h"
static const char *program_name;
puts("");
puts("Options:");
puts(_("\
- -h, --help display this help and exit\n\
- -v, --version display version information and exit"));
+ -h, --help display this help and exit\n\
+ -v, --version display version information and exit"));
puts("");
puts(_("\
- -d,--debug run in debug mode\n\
- -p,--port=PORT webserver port\n\
- -w,--wdir=DIR directory containing webserver pages"));
+ -d,--debug run in debug mode\n\
+ -p,--port=PORT webserver port\n\
+ -w,--wdir=DIR directory containing webserver pages"));
puts("");
}
#if MHD_VERSION >= 0x00090200
-static int
+static ssize_t
file_reader(void *cls, uint64_t pos, char *buf, size_t max)
#else
static int
exit(EXIT_FAILURE);
}
- printf(_("Web server started on port: %d\n"), port);
- printf(_("WWW directory: %s\n"), server_data.www_dir);
- printf(_("URL: http://localhost:%d\n"), port);
+ log_printf(LOG_INFO, _("Web server started on port: %d"), port);
+ log_printf(LOG_INFO, _("WWW directory: %s"), server_data.www_dir);
+ log_printf(LOG_INFO, _("URL: http://localhost:%d"), port);
while (!server_stop_requested) {
pthread_mutex_lock(&mutex);