All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] obex-client-tool: Set the length header
@ 2014-04-22  5:08 Martin Kampas
  2014-04-23  7:24 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Kampas @ 2014-04-22  5:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin Kampas

At least 'put' to other device with obexd v0.48 does not work without
this.
---
 tools/obex-client-tool.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/obex-client-tool.c b/tools/obex-client-tool.c
index 54dbcbb..7207c77 100644
--- a/tools/obex-client-tool.c
+++ b/tools/obex-client-tool.c
@@ -135,11 +135,19 @@ static void cmd_put(int argc, char **argv)
 		return;
 	}
 
+	struct stat st;
+	if (fstat(fd, &st) < 0) {
+		close(fd);
+		g_printerr("fstat: %s\n", strerror(errno));
+		return;
+	}
+
 	data = g_new0(struct transfer_data, 1);
 	data->fd = fd;
 
 	g_obex_put_req(obex, put_data_cb, transfer_complete, data, &err,
 						G_OBEX_HDR_NAME, argv[1],
+						G_OBEX_HDR_LENGTH, st.st_size,
 						G_OBEX_HDR_INVALID);
 	if (err != NULL) {
 		g_printerr("put failed: %s\n", err->message);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-23 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22  5:08 [PATCH] obex-client-tool: Set the length header Martin Kampas
2014-04-23  7:24 ` Luiz Augusto von Dentz
2014-04-23  7:54   ` Martin Kampas
2014-04-23  8:20     ` Luiz Augusto von Dentz
2014-04-23  8:28       ` Luiz Augusto von Dentz
2014-04-23 10:20         ` Martin Kampas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.