Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3528825pxp; Tue, 22 Mar 2022 23:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo7ZBiNQwPTMGb365W4aVsN/QccdaySCmTCr6L3RJJYDOEGtWqMZRgYmp71fnelYTIskyO X-Received: by 2002:a65:6909:0:b0:382:53c4:43c5 with SMTP id s9-20020a656909000000b0038253c443c5mr13851009pgq.502.1648018112822; Tue, 22 Mar 2022 23:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648018112; cv=none; d=google.com; s=arc-20160816; b=KQSsIQC2g0B4XBtJV+EJU/Bsd0gqhpLCihLYRn6D0qW6yMUK8F3FLmDQh1Q4YTrFa8 aQqNqtKyxUPRq10umnxavI5zCJG0Ybr9FIIvRmygSsZ7x8pHu61NMpZ05EqaybrbCujh 6qbeS6d4a6OAXTp6zvtB+fwQ0e2ohdDG8oWnvWDbm6+6Fx+sQucMYJItZ3yY4IDJSOdC sVFwJ18GlOwpdYJObczr5ZdPbhVDM3u30JTA3uaGvqfS1EqxcIheTUkJgcIpEam4CZyo Eyai6lepY3Ft0QKVrrl63IIct5GxZ8QNBYFQfGpwYc346TxEWhVK1yZl2SbjX8rgrVTo wyaQ== 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=wNnV/0CJnv9tp85gLEIosSucNc0SW+hLq8fKCwyXV/U=; b=VR0hVIwYN63tfLAqv3uDIQpP8XJmlm8v5SI9ajPW3uwbHaN4FSi/qfVaBhU43TVGJP cfwt9AZrVxBohtJG5PWggDs1CXDTLUwbAp+BjY7aeauIXp/OCcIwnVkaQd44u0Xk2GYO cRbXsogfxjOpcMfWnGs0OCwHQKDhNukhiOnJBOC4prxj+n1ubtKcsrq/wI4kakIuBvkf iKL1JYXBZN/Eq7ShRpGevI3IKl8vP5/7HkEsqWQ5/n1lCc0+PCwyyOEXLYyg0F3wG6XS Cbh02wVPnL9AWCz1YN/CovphnNeJ3kjEK2dGzUIbdawp3Mixw1PwK0mifqSsMcHzTV5a oECA== 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 g8-20020a63f408000000b003816043f11csi18084475pgi.785.2022.03.22.23.48.00; Tue, 22 Mar 2022 23:48:32 -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 S232525AbiCWFXo (ORCPT + 99 others); Wed, 23 Mar 2022 01:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbiCWFXn (ORCPT ); Wed, 23 Mar 2022 01:23:43 -0400 Received: from smtpproxy21.qq.com (smtpbg701.qq.com [203.205.195.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC3170CD3 for ; Tue, 22 Mar 2022 22:22:08 -0700 (PDT) X-QQ-mid: bizesmtp87t1648012918tdaneddp Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Mar 2022 13:21:51 +0800 (CST) X-QQ-SSF: 01400000002000C0D000000A0000000 X-QQ-FEAT: 0VgNaGdhy9gR1o7aVolNIq/TTv1x7QJEQOriKZS1Dl7ddUu+5v7eLLjFun6wU bQnC3QQgy/ermfdJYqseFr3oNmfUPOIy5IRp6whWmdByH4K642VHT56tSIfm5JeeieA2bB2 twlXKcILXA/S3cQjMQHKDTTIyvZ2yyqOx8gv5NnlUpZ6Nbqg7hBQo4oxaPIKG4yD+TpNrev FsaBlHHYKDm/ZnQz5ZWWiljIAJ1P4m98NNekpzUDDE5hzINSkJEDdHrzqfxZwYAFwSQbfD+ DYuUxeFXBmVCFKE3KwLQKaYg1gc0YPxBQ8/4DBQbDanNR9WmHBG+wcRtc1SzFbrGMgwSG7Z zGqVHmbNlWkMY4Z9fZm7IQvomlH6w== X-QQ-GoodBg: 1 From: xinpeng wang To: linux-bluetooth@vger.kernel.org Cc: xinpeng wang Subject: [PATCH] obexd: Fix can't receive small files sent by windows Date: Wed, 23 Mar 2022 13:21:49 +0800 Message-Id: <20220323052149.28674-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:qybgforeign9 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,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 | 6 +++++- obexd/src/obex.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 01741fe62..2c180dc44 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -533,8 +533,12 @@ 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