diff --git a/gobex/gobex.c b/gobex/gobex.c index 3ed410d1c..dd3f5b323 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -801,14 +801,14 @@ static void prepare_connect_rsp(GObex *obex, GObexPacket *rsp) g_obex_packet_prepend_header(rsp, connid); } -gboolean g_obex_response(GObex *obex, GObexPacket *req, guint8 rspcode, +gboolean g_obex_response(GObex *obex, guint8 opcode, guint8 rspcode, GSList *headers, GError **err) { GObexPacket *rsp; rsp = g_obex_packet_new(rspcode, TRUE, headers); - if (g_obex_packet_get_operation(req, NULL) == G_OBEX_OP_CONNECT) + if (opcode == G_OBEX_OP_CONNECT) prepare_connect_rsp(obex, rsp); return g_obex_send(obex, rsp, err); diff --git a/gobex/gobex.h b/gobex/gobex.h index aecfffa71..34ca4bf4b 100644 --- a/gobex/gobex.h +++ b/gobex/gobex.h @@ -64,7 +64,8 @@ void g_obex_unref(GObex *obex); guint g_obex_connect(GObex *obex, void *target, gsize target_len, GObexResponseFunc func, gpointer user_data, GError **err); -gboolean g_obex_response(GObex *obex, GObexPacket *req, guint8 rspcode, + +gboolean g_obex_response(GObex *obex, guint8 opcode, guint8 rspcode, GSList *headers, GError **err); #endif /* __GOBEX_H */ diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c index f82daad4b..1567c4ec9 100644 --- a/tools/obex-server-tool.c +++ b/tools/obex-server-tool.c @@ -63,9 +63,12 @@ static void disconn_func(GObex *obex, GError *err, gpointer user_data) static void req_func(GObex *obex, GObexPacket *req, gpointer user_data) { - g_print("Request 0x%02x\n", g_obex_packet_get_operation(req, NULL)); + gboolean final; + guint8 op = g_obex_packet_get_operation(req, &final); - g_obex_response(obex, req, G_OBEX_RSP_SUCCESS, NULL, NULL); + g_print("Request 0x%02x%s\n", op, final ? " (final)" : ""); + + g_obex_response(obex, op, G_OBEX_RSP_SUCCESS, NULL, NULL); } static gboolean unix_accept(GIOChannel *chan, GIOCondition cond, gpointer data)