Hide more interfaces behind the flow code.

This commit is contained in:
Ian Gulliver
2016-02-29 20:16:57 -08:00
parent 3fb3c02cf5
commit 90de5b80bc
5 changed files with 55 additions and 56 deletions

View File

@@ -37,6 +37,8 @@ struct receive {
};
static struct receive *receive_head = NULL;
static void receive_new(int, void *, struct peer *);
static struct flow _receive_flow = {
.name = "receive",
.new = receive_new,
@@ -132,13 +134,7 @@ static void receive_read(struct peer *peer) {
}
}
void receive_cleanup() {
while (receive_head) {
receive_del(receive_head);
}
}
void receive_new(int fd, void __attribute__((unused)) *passthrough, struct peer *on_close) {
static void receive_new(int fd, void __attribute__((unused)) *passthrough, struct peer *on_close) {
peer_count_in++;
socket_receive_init(fd);
@@ -164,6 +160,12 @@ void receive_new(int fd, void __attribute__((unused)) *passthrough, struct peer
fprintf(stderr, "R %s: New receive connection\n", receive->id);
}
void receive_cleanup() {
while (receive_head) {
receive_del(receive_head);
}
}
void receive_print_usage() {
fprintf(stderr, "\nSupported receive formats (auto-detected):\n");
for (size_t i = 0; i < NUM_PARSERS; i++) {