diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rexmpp.c | 2 | ||||
-rw-r--r-- | src/rexmpp_console.c | 7 | ||||
-rw-r--r-- | src/rexmpp_console.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c index 3216817..8be0fc4 100644 --- a/src/rexmpp.c +++ b/src/rexmpp.c @@ -2400,8 +2400,10 @@ rexmpp_err_t rexmpp_run (rexmpp_t *s, fd_set *read_fds, fd_set *write_fds) { } if (s->tcp_state == REXMPP_TCP_CLOSED) { + rexmpp_console_on_run(s, REXMPP_SUCCESS); return REXMPP_SUCCESS; } else { + rexmpp_console_on_run(s, REXMPP_E_AGAIN); return REXMPP_E_AGAIN; } } diff --git a/src/rexmpp_console.c b/src/rexmpp_console.c index 47c0bfa..3bafd88 100644 --- a/src/rexmpp_console.c +++ b/src/rexmpp_console.c @@ -119,6 +119,13 @@ void rexmpp_console_on_recv (rexmpp_t *s, xmlNodePtr node) { } } +void rexmpp_console_on_run (rexmpp_t *s, rexmpp_err_t result) { + if (result == REXMPP_SUCCESS) { + rexmpp_console_printf(s, "Done.\n"); + return; + } +} + void rexmpp_console_feed (rexmpp_t *s, char *str, ssize_t str_len) { /* todo: buffering */ char *words_save_ptr; diff --git a/src/rexmpp_console.h b/src/rexmpp_console.h index a7841a5..85e3d75 100644 --- a/src/rexmpp_console.h +++ b/src/rexmpp_console.h @@ -13,6 +13,7 @@ void rexmpp_console_on_send (rexmpp_t *s, xmlNodePtr node); void rexmpp_console_on_recv (rexmpp_t *s, xmlNodePtr node); +void rexmpp_console_on_run (rexmpp_t *s, rexmpp_err_t result); void rexmpp_console_feed (rexmpp_t *s, char *str, ssize_t str_len); #endif |