summaryrefslogtreecommitdiff
path: root/server/src/sessionheaderparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/sessionheaderparser.cc')
-rw-r--r--server/src/sessionheaderparser.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/server/src/sessionheaderparser.cc b/server/src/sessionheaderparser.cc
index afdaa65..b62e122 100644
--- a/server/src/sessionheaderparser.cc
+++ b/server/src/sessionheaderparser.cc
@@ -54,28 +54,20 @@
#include <errno.h>
#include <string.h>
-#include "debug.h"
+#include <hugin.hpp>
#include "configuration.h"
#include "exception.h"
void SessionHeaderParser::error(const char* fmt, ...)
{
- ERR_LOG(session, "Error in SessionHeaderParser: ");
-
- {
- va_list argp;
- va_start(argp, fmt);
- ERR_LOG_VA(session, fmt, argp);
- va_end(argp);
-
- fprintf(stderr, "\n");
- }
+ ERR(session, "Error in SessionHeaderParser: ");
{
char *p;
va_list argp;
va_start(argp, fmt);
if(vasprintf(&p, fmt, argp) != -1) {
+ ERR(session, "%s", p);
throw Exception("Error in SessionHeaderParser: " + std::string(p));
free(p);
}
@@ -129,12 +121,12 @@ int SessionHeaderParser::readData(char *data, size_t size)
// for and can dismiss the rest of the document.
if(fd == -1) {
- ERR_LOG(session, "Invalid file descriptor.\n");
+ ERR(session, "Invalid file descriptor.\n");
return 0;
}
ssize_t r = read(fd, data, size);
if(r == -1) {
- ERR_LOG(session, "Could not read...%s\n", strerror(errno));
+ ERR(session, "Could not read...%s\n", strerror(errno));
return 0;
}
return r;
@@ -145,11 +137,11 @@ void SessionHeaderParser::parseError(const char *buf, size_t len, std::string er
if(done) return; // If done is true we already found what we were looking
// for and can dismiss the rest of the document.
- ERR_LOG(session, "SessionHeaderParser[%s] error at line %d: %s\n",
+ ERR(session, "SessionHeaderParser[%s] error at line %d: %s\n",
file.c_str(), lineno, error.c_str());
- ERR_LOG(session, "\tBuffer %u bytes: [", (int)len);
+ ERR(session, "\tBuffer %u bytes: [", (int)len);
if(fwrite(buf, len, 1, stderr) != len) {}
- ERR_LOG(session, "]\n");
+ ERR(session, "]\n");
char *slineno;
if(asprintf(&slineno, " at line %d\n", lineno) != -1) {