Diff between ddb69649e8d0d665366bfb468af317de0363182c and 3352a36c11596e49962abe2b60e5094f4ea385ea

Changed Files

File Additions Deletions Status
gobex/gobex.c +6 -2 modified
gobex/gobex.h +2 -1 modified
tools/obex-server-tool.c +4 -2 modified

Full Patch

diff --git a/gobex/gobex.c b/gobex/gobex.c
index 1a0e048..40757f3 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -483,11 +483,15 @@ immediate_completion:
 	return TRUE;
 }
 
-gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err)
+gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err,
+						guint8 first_hdr_type, ...)
 {
 	GObexPacket *rsp;
+	va_list args;
 
-	rsp = g_obex_packet_new(rspcode, TRUE, G_OBEX_HDR_INVALID);
+	va_start(args, first_hdr_type);
+	rsp = g_obex_packet_new_valist(rspcode, TRUE, first_hdr_type, args);
+	va_end(args);
 
 	return g_obex_send(obex, rsp, err);
 }
diff --git a/gobex/gobex.h b/gobex/gobex.h
index 7c2d4b7..a8424f3 100644
--- a/gobex/gobex.h
+++ b/gobex/gobex.h
@@ -49,7 +49,8 @@ guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
 gboolean g_obex_cancel_req(GObex *obex, guint req_id,
 						gboolean remove_callback);
 
-gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err);
+gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err,
+						guint8 first_hdr_type, ...);
 
 void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
 							gpointer user_data);
diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
index a4cf327..3b71ac0 100644
--- a/tools/obex-server-tool.c
+++ b/tools/obex-server-tool.c
@@ -127,7 +127,8 @@ static void handle_put(GObex *obex, GObexPacket *req, gpointer user_data)
 	if (data->fd < 0) {
 		g_printerr("open(%s): %s\n", name, strerror(errno));
 		g_free(data);
-		g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL);
+		g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL,
+							G_OBEX_HDR_INVALID);
 		return;
 	}
 
@@ -181,7 +182,8 @@ static void handle_get(GObex *obex, GObexPacket *req, gpointer user_data)
 	if (data->fd < 0) {
 		g_printerr("open(%s): %s\n", name, strerror(errno));
 		g_free(data);
-		g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL);
+		g_obex_send_rsp(obex, G_OBEX_RSP_FORBIDDEN, NULL,
+							G_OBEX_HDR_INVALID);
 		return;
 	}