Closed Bug 819832 Opened 12 years ago Closed 12 years ago

[b2g-bluetooth] Sending files to Mac would fail at the end of sending process

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla20
blocking-basecamp +
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: echou, Assigned: gyeh)

References

Details

(Whiteboard: [LOE:S])

Attachments

(1 file, 2 obsolete files)

Although sending files to laptop installed with Ubuntu 12.04/12.10 and several Android devices(HTC Sensation XL, HTC One S, Samsung Galaxy S2) worked, sharing file with Mac would fail at the end of sending process. 

This is a Gecko issue, nominated as bb+.
Blocks: 792683
Severity: normal → major
blocking-basecamp: --- → ?
Assignee: nobody → gyeh
Whiteboard: [LOE:S]
Send a PutFinal packet with End-of-Body header at the end of transferring.
Attachment #690305 - Flags: review?(echou)
Comment on attachment 690305 [details] [diff] [review]
Patch 1(v1): Sending files to Mac would fail at the end of sending process

Review of attachment 690305 [details] [diff] [review]:
-----------------------------------------------------------------

There is a description in chapter 3 "Session Protocol" of OBEX spec 1.2, "Once a request is issued, the client waits for a response from the server before issuing another request. The request/response pair is referred to as an operation." So the patch has to be revised, otherwise we may send a [Put(f)/EndOfBody] request before receiving the response of the last [Put(c)/Body].

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +909,5 @@
>    UnixSocketRawData* s = new UnixSocketRawData(index);
>    memcpy(s->mData, req, s->mSize);
>    SendSocketData(s);
>  
> +  if (aFinal) {

Here we are going to send a packet with header [End-Of-Body] without content. I suggest to write comments to describe the reason why we do so.

@@ +913,5 @@
> +  if (aFinal) {
> +    // Section 2.2.9 "End-of-Body", IrObex 1.2
> +    // [opcode:1][length:2]
> +    index = 3;
> +    index += AppendHeaderEndOfBody(&req[index]);

I think we don't have function AppendHeaderEndOfBody in ObexBase.cpp yet. Miss something?

@@ +914,5 @@
> +    // Section 2.2.9 "End-of-Body", IrObex 1.2
> +    // [opcode:1][length:2]
> +    index = 3;
> +    index += AppendHeaderEndOfBody(&req[index]);
> +    SetObexPacketInfo(req, ObexRequestCode::PutFinal, 6);

Please use variable "index" instead of magic number 6.

@@ +917,5 @@
> +    index += AppendHeaderEndOfBody(&req[index]);
> +    SetObexPacketInfo(req, ObexRequestCode::PutFinal, 6);
> +    mLastCommand = ObexRequestCode::PutFinal;
> +
> +    s = new UnixSocketRawData(6);

Please use variable "index" instead of magic number 6.
Attachment #690305 - Flags: review?(echou) → review-
Send PutFinal packet with a zero length End-of-Body header after we get response of last Put packet from the remote.
Attachment #690305 - Attachment is obsolete: true
Attachment #690334 - Flags: review?(echou)
Comment on attachment 690334 [details] [diff] [review]
Patch 1(v2): Sending files to Mac would fail at the end of sending process

Review of attachment 690334 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with nit addressed.

::: dom/bluetooth/BluetoothOppManager.cpp
@@ +920,5 @@
> +
> +void
> +BluetoothOppManager::SendPutFinalRequest()
> +{
> +  LOG("[O] %s", __FUNCTION__); 

I guess this should be removed? :)

::: dom/bluetooth/ObexBase.cpp
@@ +45,5 @@
> +
> +  return 3;
> +}
> +
> +

Nit: remove an additional line
Attachment #690334 - Flags: review?(echou) → review+
blocking-basecamp: ? → +
https://hg.mozilla.org/integration/mozilla-inbound/rev/5908a3ce5507

This patch still have conflicts on mozilla-beta and mozilla-aurora, so mark approval-mozilla-beta and approval-mozilla-aurora in Bug 802288. Please land this patch after Bug 802288. Thanks.
https://hg.mozilla.org/mozilla-central/rev/5908a3ce5507
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Whiteboard: [LOE:S][status-b2g18:fixed] → [LOE:S]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: