summaryrefslogtreecommitdiff
path: root/android/socket.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2013-11-28 16:38:04 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-11-29 10:30:02 +0200
commit4df38bd9ed05e981e513f26a43de3e6eb578f7e2 (patch)
treeca4a293192bfd349433141ebfd878dfe58c8b569 /android/socket.c
parent995d19a8d42a01c66e15346f8ad2fc36f847fdf0 (diff)
downloadbluez-4df38bd9ed05e981e513f26a43de3e6eb578f7e2.tar.gz
android/socket: Strip extra log messages
Remove debug messages when sending data, debug still exist for connection establishment. Do not print error when connection hang up, print debug instead.
Diffstat (limited to 'android/socket.c')
-rw-r--r--android/socket.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/android/socket.c b/android/socket.c
index 85f1ec47b..6e3ef26f8 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -488,11 +488,12 @@ static gboolean sock_stack_event_cb(GIOChannel *io, GIOCondition cond,
unsigned char buf[1024];
int len, sent;
- DBG("rfsock: fd %d real_sock %d chan %u sock %d",
- rfsock->fd, rfsock->real_sock, rfsock->channel,
- g_io_channel_unix_get_fd(io));
+ if (cond & G_IO_HUP) {
+ DBG("Socket %d hang up", g_io_channel_unix_get_fd(io));
+ goto fail;
+ }
- if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
+ if (cond & (G_IO_ERR | G_IO_NVAL)) {
error("Socket error: sock %d cond %d",
g_io_channel_unix_get_fd(io), cond);
goto fail;
@@ -505,16 +506,12 @@ static gboolean sock_stack_event_cb(GIOChannel *io, GIOCondition cond,
return TRUE;
}
- DBG("read %d bytes write to %d", len, rfsock->real_sock);
-
sent = try_write_all(rfsock->real_sock, buf, len);
if (sent < 0) {
error("write(): %s", strerror(errno));
goto fail;
}
- DBG("Written %d bytes", sent);
-
return TRUE;
fail:
connections = g_list_remove(connections, rfsock);
@@ -530,11 +527,12 @@ static gboolean sock_rfcomm_event_cb(GIOChannel *io, GIOCondition cond,
unsigned char buf[1024];
int len, sent;
- DBG("rfsock: fd %d real_sock %d chan %u sock %d",
- rfsock->fd, rfsock->real_sock, rfsock->channel,
- g_io_channel_unix_get_fd(io));
+ if (cond & G_IO_HUP) {
+ DBG("Socket %d hang up", g_io_channel_unix_get_fd(io));
+ goto fail;
+ }
- if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
+ if (cond & (G_IO_ERR | G_IO_NVAL)) {
error("Socket error: sock %d cond %d",
g_io_channel_unix_get_fd(io), cond);
goto fail;
@@ -547,16 +545,12 @@ static gboolean sock_rfcomm_event_cb(GIOChannel *io, GIOCondition cond,
return TRUE;
}
- DBG("read %d bytes, write to fd %d", len, rfsock->fd);
-
sent = try_write_all(rfsock->fd, buf, len);
if (sent < 0) {
error("write(): %s", strerror(errno));
goto fail;
}
- DBG("Written %d bytes", sent);
-
return TRUE;
fail:
connections = g_list_remove(connections, rfsock);