+bool flush_meta(connection_t *c)
+{
+ int result;
+
+ ifdebug(META) logger(LOG_DEBUG, _("Flushing %d bytes to %s (%s)"),
+ c->outbuflen, c->name, c->hostname);
+
+ while(c->outbuflen) {
+ result = send(c->socket, c->outbuf + c->outbufstart, c->outbuflen, 0);
+ if(result <= 0) {
+ if(!errno || errno == EPIPE) {
+ ifdebug(CONNECTIONS) logger(LOG_NOTICE, _("Connection closed by %s (%s)"),
+ c->name, c->hostname);
+ } else if(errno == EINTR) {
+ continue;
+#ifdef EWOULDBLOCK
+ } else if(errno == EWOULDBLOCK) {
+ ifdebug(CONNECTIONS) logger(LOG_DEBUG, _("Flushing %d bytes to %s (%s) would block"),
+ c->outbuflen, c->name, c->hostname);
+ return true;
+#endif
+ } else {
+ logger(LOG_ERR, _("Flushing meta data to %s (%s) failed: %s"), c->name,
+ c->hostname, strerror(errno));
+ }
+
+ return false;
+ }
+
+ c->outbufstart += result;
+ c->outbuflen -= result;
+ }
+
+ c->outbufstart = 0; /* avoid unnecessary memmoves */
+ return true;
+}
+
+void broadcast_meta(connection_t *from, const char *buffer, int length)