Closed Bug 788081 Opened 7 years ago Closed 7 years ago

B2G tethering: correctly handle 1xx responses from netd

Categories

(Core :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18
blocking-basecamp -

People

(Reporter: vchang, Assigned: vchang)

References

Details

Attachments

(2 files, 1 obsolete file)

Netd's 1xx message indicates that the requested command was initiated; expect another reply before proceeding with a new command. For instance, if we send "interface list" command, we may receive several 1xx responses from netd. The command is complete until we receive 2xx, 4xx and 5xx response.   
 
Network Worker: Preparing to send 'interface list' command...
Network Worker: Sending 'interface list' command to netd.
Network Worker: Receiving 'interface list' command response from netd.
Network Worker:           ==> Code: 110  Reason: lo
Network Worker: Receiving 'interface list' command response from netd.
Network Worker:           ==> Code: 110  Reason: rmnet0
...
Network Worker: Receiving 'interface list' command response from netd.
Network Worker:           ==> Code: 110  Reason: ip6tnl0
Network Worker: Receiving 'interface list' command response from netd.
Network Worker:           ==> Code: 200  Reason: Interface list completed
This seems like an important fix to prevent races or premature returns to the main threads, so I guess this should block? Vincent, please clarify. Tentatively nom'ing for blocking.
Blocks: 735172
blocking-basecamp: --- → ?
OS: Linux → Gonk
Product: Boot2Gecko → Core
Hardware: x86_64 → ARM
Summary: Support 1xx response message from netd → B2G tethering: correctly handle 1xx responses from netd
Attached patch Support 1xx message (obsolete) — Splinter Review
Support netd's 1xx response message.
Attachment #658427 - Flags: review?(philipp)
Assignee: nobody → vchang
(In reply to Philipp von Weitershausen [:philikon] from comment #1)
> This seems like an important fix to prevent races or premature returns to
> the main threads, so I guess this should block? Vincent, please clarify.
> Tentatively nom'ing for blocking.

Vincent, can you please clarify whether this fix is an absolutely must-have for shipping the phone?
Whiteboard: [blocked-on-input Vincent Chang]
There are four netd commands using 1xx responses. They are     
"interface list"          => list network interfaces. 
"tether interface list 0" => list tethering interfaces.
"tether dns list 0"       => list dns forwarding addresses 
"list_ttys"               => list tty devices

We don't use these commands for tethering. But it is nice to fix it 
so that we can support these netd commands. I don't think this fix 
is a must-have for shipping the phone.
Thanks, Vincent.  Not a blocker.
blocking-basecamp: ? → -
Whiteboard: [blocked-on-input Vincent Chang]
Comment on attachment 658427 [details] [diff] [review]
Support 1xx message

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

::: dom/system/gonk/net_worker.js
@@ +42,5 @@
>  
>  importScripts("systemlibs.js");
>  
> +function netdResponseType(code) {
> +  // 1xx

How about

  function netdResponseType(code) {
    return Math.floor(code / 100);
  }

r=me with that :)
Attachment #658427 - Flags: review?(philipp) → review+
Updated the patch to address comment 7.
Attachment #658427 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/a2bd4bc59452
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.