Diff between 8888c5ae47209d1fe07de62bf51928d26d786fa4 and bc076f84377baa27ea399c60ad0ed29bd13ffbd2

Changed Files

File Additions Deletions Status
tools/obex-server-tool.c +17 -2 modified

Full Patch

diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
index 1567c4e..9f4e9c6 100644
--- a/tools/obex-server-tool.c
+++ b/tools/obex-server-tool.c
@@ -64,11 +64,26 @@ 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 op = g_obex_packet_get_operation(req, &final);
+	guint8 rsp, op = g_obex_packet_get_operation(req, &final);
 
 	g_print("Request 0x%02x%s\n", op, final ? " (final)" : "");
 
-	g_obex_response(obex, op, G_OBEX_RSP_SUCCESS, NULL, NULL);
+	switch (op) {
+	case G_OBEX_OP_CONNECT:
+		rsp = 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;
+		else
+			rsp = G_OBEX_RSP_SUCCESS;
+		break;
+	default:
+		rsp = G_OBEX_RSP_NOT_IMPLEMENTED;
+		break;
+	}
+
+	g_obex_response(obex, op, rsp, NULL, NULL);
 }
 
 static gboolean unix_accept(GIOChannel *chan, GIOCondition cond, gpointer data)