diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-11-22 02:06:41 +0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-01-14 23:36:38 +0100 |
commit | 226ea7a96485f2b9db13b523551c536dc68a1689 (patch) | |
tree | c2e90a49e934d31ca6e22678888e63c07785f856 /slirp/tcp_input.c | |
parent | 2a2d3e4a258b9ed7ef5be7c6e421d58a365a0297 (diff) |
slirp: call into g_debug() for DEBUG macros
Make slirp use GLib logging, instead of fprintf(), so that
applications can filter log, process it etc.
With recent versions of glib, G_MESSAGES_DEBUG must be set to "all" or
"Slirp" to see slirp debug messages.
Reformat DEBUG_MISC & DEBUG_ERROR calls to not need \n ending.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r-- | slirp/tcp_input.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c index 585ed1cb2f..de5b74a52b 100644 --- a/slirp/tcp_input.c +++ b/slirp/tcp_input.c @@ -641,8 +641,7 @@ findso: (errno != EINPROGRESS) && (errno != EWOULDBLOCK) ) { uint8_t code; - DEBUG_MISC(" tcp fconnect errno = %d-%s\n", - errno,strerror(errno)); + DEBUG_MISC(" tcp fconnect errno = %d-%s", errno, strerror(errno)); if(errno == ECONNREFUSED) { /* ACK the SYN, send RST to refuse the connection */ tcp_respond(tp, ti, m, ti->ti_seq + 1, (tcp_seq) 0, @@ -1011,7 +1010,7 @@ trimthenstep6: if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) { if (ti->ti_len == 0 && tiwin == tp->snd_wnd) { - DEBUG_MISC(" dup ack m = %p so = %p\n", m, so); + DEBUG_MISC(" dup ack m = %p so = %p", m, so); /* * If we have outstanding data (other than * a window probe), this is a completely @@ -1550,7 +1549,7 @@ tcp_mss(struct tcpcb *tp, u_int offer) (mss - (TCP_RCVSPACE % mss)) : 0)); - DEBUG_MISC(" returning mss = %d\n", mss); + DEBUG_MISC(" returning mss = %d", mss); return mss; } |