refactor move flow control to server.c

Signed-off-by: Andy Green <andy.green@linaro.org>
4 files changed