+static void handle_control_data(struct bufferevent *event, void *data) {
+ char *line = evbuffer_readline(event->input);
+ if(!line)
+ return;
+
+ if(!strcasecmp(line, "stop")) {
+ logger(LOG_NOTICE, _("Got stop command"));
+ event_loopexit(NULL);
+ return;
+ }
+
+ logger(LOG_DEBUG, _("Malformed control command received"));
+ close(event->ev_read.ev_fd);
+ splay_delete(control_socket_tree, event);
+}