Closed Bug 1359938 Opened 3 years ago Closed 3 years ago

Socket status events and tcp fast open


(Core :: Networking: HTTP, defect)

55 Branch
Not set



Tracking Status
firefox55 --- fixed


(Reporter: dragana, Assigned: dragana)



(Whiteboard: [necko-active])


(1 file, 2 obsolete files)

During TFO we buffer data in TCPFastOpenLayer before we call sendto. This is needed because we can only call sendto once and we need to have all data that we want to send in one buffer.

This breaks timing of socket status events.

When we call PR_Write during TFO we do not send data so we should not send NS_NET_STATUS_SENDING_TO event either. The data will be send when we call TCPFastOpenFinish or after the socket is connected.

When socket is connected we need to send the rest of buffered data before we call OnSocketReady, because OnSocketReady can trigger NS_NET_STATUS_WAITING_FOR event.

We need to move call of nsHttpTransaction::SetRequestStart from nsHttpTransaction::ReadRequestSegment because this can be called during TFO as well.
Assignee: nobody → dd.mozilla
Whiteboard: [necko-active]
Attachment #8862075 - Flags: review?(valentin.gosu)
Attachment #8862075 - Flags: review?(mcmanus)
Attachment #8862075 - Flags: review?(mcmanus)
thanks for including the try report unfortunately its lit up all orange with

Assertion failure: false, at /home/worker/workspace/build/src/security/manager/ssl/nsNSSIOLayer.cpp:1181

so I'll drop the review for now..
Attachment #8862075 - Attachment is obsolete: true
Attachment #8862075 - Flags: review?(valentin.gosu)
Attachment #8862193 - Flags: review?(valentin.gosu)
Attachment #8862193 - Flags: review?(mcmanus)
Comment on attachment 8862193 [details] [diff] [review]

I am dropping review flags.

The problem is not 1359847. I do not know what it is. I am investigating. (I cannot reproduce it locally so it is fun to debug.)
Attachment #8862193 - Flags: review?(valentin.gosu)
Attachment #8862193 - Flags: review?(mcmanus)
The problem is bug 1340854. If we do PR_Write with 0 bytes to be written assertions can be hit. I will check if we can call PR_Write(nullptr,0,...) or we are not allowed anymore. I assume that is a regression from bug 1340854. If nss wants it that way I will change my patch.
So this try failure are a regression from bug 1340854. This is not a really important regression, just a minor thing.

But from ekr's comment, we can not call PR_Write because this will not always call send or recv on a layer under NSS. And we can end up in a deadlock :) - NSS think it has sent data and does not want to call send/recv, but that data sits in a buffer in the layer below.

I will update the patch to call TCPFAstOpenLayer:Send directly not utilizing PR_Write.
Comment on attachment 8862619 [details] [diff] [review]

Review of attachment 8862619 [details] [diff] [review]:

::: netwerk/base/TCPFastOpenLayer.cpp
@@ +64,5 @@

i like this
Attachment #8862619 - Flags: review?(mcmanus) → review+
Attachment #8862619 - Flags: review?(valentin.gosu) → review+
Pushed by
Fix socket status events for TCP Fast Open. r=mcmanus
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Depends on: 1362978
You need to log in before you can comment on or make changes to this bug.