meshlink_handle_t *mesh = c->mesh;
if(!c) {
- logger(DEBUG_ALWAYS, LOG_ERR, "send_meta_sptps() called with NULL pointer!");
+ logger(mesh, MESHLINK_ERROR, "send_meta_sptps() called with NULL pointer!");
abort();
}
bool send_meta(meshlink_handle_t *mesh, connection_t *c, const char *buffer, int length) {
if(!c) {
- logger(DEBUG_ALWAYS, LOG_ERR, "send_meta() called with NULL pointer!");
+ logger(mesh, MESHLINK_ERROR, "send_meta() called with NULL pointer!");
abort();
}
- logger(DEBUG_META, LOG_DEBUG, "Sending %d bytes of metadata to %s (%s)", length,
+ logger(mesh, MESHLINK_DEBUG, "Sending %d bytes of metadata to %s (%s)", length,
c->name, c->hostname);
if(c->allow_request == ID) {
char *request = (char *)data;
if(!c) {
- logger(DEBUG_ALWAYS, LOG_ERR, "receive_meta_sptps() called with NULL pointer!");
+ logger(mesh, MESHLINK_ERROR, "receive_meta_sptps() called with NULL pointer!");
abort();
}
buffer_compact(&c->inbuf, MAXBUFSIZE);
if(sizeof inbuf <= c->inbuf.len) {
- logger(DEBUG_ALWAYS, LOG_ERR, "Input buffer full for %s (%s)", c->name, c->hostname);
+ logger(mesh, MESHLINK_ERROR, "Input buffer full for %s (%s)", c->name, c->hostname);
return false;
}
if(inlen <= 0) {
if(!inlen || !errno) {
- logger(DEBUG_CONNECTIONS, LOG_NOTICE, "Connection closed by %s (%s)",
+ logger(mesh, MESHLINK_INFO, "Connection closed by %s (%s)",
c->name, c->hostname);
} else if(sockwouldblock(sockerrno))
return true;
else
- logger(DEBUG_ALWAYS, LOG_ERR, "Metadata socket read error for %s (%s): %s",
+ logger(mesh, MESHLINK_ERROR, "Metadata socket read error for %s (%s): %s",
c->name, c->hostname, sockstrerror(sockerrno));
return false;
}