+void handle_meta_write(int sock, short events, void *data) {
+ ifdebug(META) logger(LOG_DEBUG, "handle_meta_write() called");
+
+ connection_t *c = data;
+
+ size_t outlen = write(c->socket, c->outbuf.data + c->outbuf.offset, c->outbuf.len - c->outbuf.offset);
+ if(outlen <= 0) {
+ logger(LOG_ERR, "Onoes, outlen = %zd (%s)", outlen, strerror(errno));
+ terminate_connection(c, c->status.active);
+ return;
+ }
+
+ buffer_read(&c->outbuf, outlen);
+ if(!c->outbuf.len)
+ event_del(&c->outevent);
+}
+
+void handle_meta_connection_error(struct bufferevent *event, short what, void *data) {
+ connection_t *c = data;
+ logger(LOG_ERR, "handle_meta_connection_error() called: %d: %s", what, strerror(errno));
+ terminate_connection(c, c->status.active);
+}
+