diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-07-05 18:57:23 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-04 22:21:59 +0100 |
commit | 49514b2cc4e8cbb1a71b69c5f63fd59dc20bb46b (patch) | |
tree | fdbb0c4fbebd26b901dbd2284b753dcbc327c96d /tools/obex-server-tool.c | |
parent | b1cc9a1269d04100d714886aeb3c143fb76e64b4 (diff) | |
download | bluez-49514b2cc4e8cbb1a71b69c5f63fd59dc20bb46b.tar.gz |
gobex: Track last received request internally and remove g_obex_response
Diffstat (limited to 'tools/obex-server-tool.c')
-rw-r--r-- | tools/obex-server-tool.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c index 9f4e9c627..37c95a5d0 100644 --- a/tools/obex-server-tool.c +++ b/tools/obex-server-tool.c @@ -64,26 +64,28 @@ static void disconn_func(GObex *obex, GError *err, gpointer user_data) static void req_func(GObex *obex, GObexPacket *req, gpointer user_data) { gboolean final; - guint8 rsp, op = g_obex_packet_get_operation(req, &final); + guint8 rspcode, op = g_obex_packet_get_operation(req, &final); + GObexPacket *rsp; g_print("Request 0x%02x%s\n", op, final ? " (final)" : ""); switch (op) { case G_OBEX_OP_CONNECT: - rsp = G_OBEX_RSP_SUCCESS; + rspcode = G_OBEX_RSP_SUCCESS; break; case G_OBEX_OP_PUT: if (g_obex_packet_find_header(req, G_OBEX_HDR_ID_BODY)) - rsp = G_OBEX_RSP_CONTINUE; + rspcode = G_OBEX_RSP_CONTINUE; else - rsp = G_OBEX_RSP_SUCCESS; + rspcode = G_OBEX_RSP_SUCCESS; break; default: - rsp = G_OBEX_RSP_NOT_IMPLEMENTED; + rspcode = G_OBEX_RSP_NOT_IMPLEMENTED; break; } - g_obex_response(obex, op, rsp, NULL, NULL); + rsp = g_obex_packet_new(rspcode, TRUE, NULL); + g_obex_send(obex, rsp, NULL); } static gboolean unix_accept(GIOChannel *chan, GIOCondition cond, gpointer data) |