From: Hendrik S. <po...@he...> - 2011-04-13 17:04:02
|
From: Hendrik Sattler <po...@he...> --- lib/obex.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/obex.c b/lib/obex.c index 50ed7e4..3e1f71c 100644 --- a/lib/obex.c +++ b/lib/obex.c @@ -476,9 +476,13 @@ LIB_SYMBOL int CALLAPI OBEX_TransportDisconnect(obex_t *self) { DEBUG(4, "\n"); - obex_return_val_if_fail(self != NULL, -1); - obex_transport_disconnect_request(self); + + if (self->trans.fd != INVALID_SOCKET) + obex_transport_disconnect_request(self); + else if (self->trans.serverfd != INVALID_SOCKET) + obex_transport_disconnect_server(self); + return 0; } -- 1.7.4.1 |