Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1009830pxb; Thu, 24 Mar 2022 10:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPeAuFyAp6NAdoSwTpcJPEanCpu3xj3vW1XTXc12+RtEUt4uwpK9+8L9nfHwpBuxFODMMj X-Received: by 2002:aa7:cf08:0:b0:418:e5f7:b2a1 with SMTP id a8-20020aa7cf08000000b00418e5f7b2a1mr7881015edy.76.1648144773556; Thu, 24 Mar 2022 10:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648144773; cv=none; d=google.com; s=arc-20160816; b=G40qSAocre6XpY28LLaZyud/YUzwqRf1rAKwV+jbjFBPqMVisVy+RlWoPXazr+we2M 3wQwh0qzEvJcmHJljAbCCeWE+qWrQL26zVpPiejLy+pIo6uMmxJqPRIROZ7vu7F1sCBB SBDs2Qmfs0flDpyg91uyaRCMNiAYK5N3OxgeBaHyXjVmSM54w+Q0J17i19YnPHRfdXlg 92eDTM4fq1nAZNcloa3DOJa1fHOCDnIZXi/yJkEksMa14e5cMPNnn91drOZ7YeWH06yx OWzOajZ6caLcEpLqWQkodY2AZ/9x8kQ0D+FM1DmeaLKjA036uPk5fEEFUkZPtAIeZJJl 1h1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=vZtDeyPf4gjptVBjkIXbzfiDILmUUZtnYwlqskSMUns=; b=BxmVmHEdFZkYlXio68UthRynUpv9XCbkCJTkTKdKKkuJkwWwnJYItz2yO4A/Lyy944 7JA6b2/KgtAW/2HXk7RcbFij+Syo1jEocWMBzq8uKzRJF2WN88q0W/jW53PYhsUAtG4s L7EwXBKF95XNlZHN5lpZzMcxmJMgIWO4TCsUAi8b8/LGu+fZDpE+DP4+tXe+xN3GIlYe AaLHMwW+gQkIkKAYlmGvRcNT9A3AsWe9I4SqrM7GGNQGSqxC4xCsVEAPUeUtKk++XMor xdfAfnBmxy26BWZjheZWwNgL599sjzKDNQD87hqf9h/UC9KPtfPgrrqnb4Rn9jFMiAan WXFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kz10-20020a17090777ca00b006df76385e5asi37772ejc.762.2022.03.24.10.58.53; Thu, 24 Mar 2022 10:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbiCWDiF (ORCPT + 99 others); Tue, 22 Mar 2022 23:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241578AbiCWDh7 (ORCPT ); Tue, 22 Mar 2022 23:37:59 -0400 Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82AB570CD1 for ; Tue, 22 Mar 2022 20:36:25 -0700 (PDT) X-QQ-mid: bizesmtp63t1648006579tb7ls3za Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Mar 2022 11:36:14 +0800 (CST) X-QQ-SSF: 01400000000000C0D000B00A0000000 X-QQ-FEAT: jfdGVjI73+QTWEhMp8TSi/75ht75hgsMCPpObJyTMLuOSwgd3u1PfXpJ+1bDA D87S92Qvh8aW1gQYy4dYfn8UlFGES5s87i+zEtjxdN8Wk4/+YE5HGrQWp0eiH/b6rQdfbjm FZ3rgJ1wKUtEoOh6SM7z1n8W8NxnIlrFVqNrAywSxJzzuOby+lwX2gLEsQ968aO2UAY/ljJ qmJEoLeFQ6KwuGb3JciD1Gahft56v9OES34+EvZO6Lmhu7RVHrQqvk3dUtuxeQhNr9FzQGO oxRDO6JjNeevp8yGCNbf9FTn7BrPSbdvfHOSRNCDg56a6YBkRq3ItTjygA/JlQHEdSQHt/e 8i40WMeunr8w7/kOEQ= X-QQ-GoodBg: 2 From: xinpeng wang To: linux-bluetooth@vger.kernel.org Cc: xinpeng wang Subject: [PATCH] obexd: Fix cann't receive small files sent by windows Date: Wed, 23 Mar 2022 11:36:12 +0800 Message-Id: <20220323033612.12132-1-wangxinpeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Windows devices use streaming mode to send files. If a small file is sent,the first time processing data will be completed successfully, and the transfer_complete function will be called before the end to clear os->path.At this time, the dbus signal is still pending, and the dbus method call requesting the file path has not been processed; in this way, the upper-level program will not be able to obtain the file path, resulting in failure to receive the file. Therefore, the signal of Filename is generated, and it is forced to be sent when status=active. Signed-off-by: xinpeng wang --- obexd/src/manager.c | 5 ++++- obexd/src/obex.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 01741fe62..ba9ad43e6 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -533,8 +533,11 @@ void manager_emit_transfer_property(struct obex_transfer *transfer, void manager_emit_transfer_started(struct obex_transfer *transfer) { transfer->status = TRANSFER_STATUS_ACTIVE; + if (!transfer->path) + return; - manager_emit_transfer_property(transfer, "Status"); + g_dbus_emit_property_changed_full(connection, transfer->path, + TRANSFER_INTERFACE, "Status",G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH); } static void emit_transfer_completed(struct obex_transfer *transfer, diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 3a68fd66c..c0d9e160a 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -720,6 +720,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename) manager_emit_transfer_property(os->service_data, "Size"); os->path = g_strdup(filename); + manager_emit_transfer_property(os->service_data, "Filename"); return 0; } -- 2.20.1