#include "system.h"
-#include "splay_tree.h"
#include "cipher.h"
#include "connection.h"
#include "logger.h"
abort();
}
- logger(DEBUG_META, LOG_DEBUG, "send_meta_sptps(%s, %p, %d)", c->name, buffer, (int)length);
-
buffer_add(&c->outbuf, buffer, length);
event_add(&c->outevent, NULL);
}
void broadcast_meta(connection_t *from, const char *buffer, int length) {
- splay_node_t *node;
- connection_t *c;
-
- for(node = connection_tree->head; node; node = node->next) {
- c = node->data;
+ for(list_node_t *node = connection_list->head, *next; node; node = next) {
+ next = node->next;
+ connection_t *c = node->data;
if(c != from && c->status.active)
send_meta(c, buffer, length);
abort();
}
- logger(DEBUG_META, LOG_DEBUG, "receive_meta_sptps(%s, %d, %p, %hu)", c->name, type, data, length);
-
if(type == SPTPS_HANDSHAKE) {
if(c->allow_request == ACK)
return send_ack(c);
}
do {
- if(c->protocol_minor >= 2) {
- logger(DEBUG_META, LOG_DEBUG, "Receiving %d bytes of SPTPS data", inlen);
+ if(c->protocol_minor >= 2)
return sptps_receive_data(&c->sptps, bufp, inlen);
- }
if(!c->status.decryptin) {
endp = memchr(bufp, '\n', inlen);
bufp = endp;
} else {
size_t outlen = inlen;
- logger(DEBUG_META, LOG_DEBUG, "Received encrypted %d bytes", inlen);
if(!cipher_decrypt(&c->incipher, bufp, inlen, buffer_prepare(&c->inbuf, inlen), &outlen, false) || inlen != outlen) {
logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting metadata from %s (%s)",