Closed
Bug 1331810
Opened 7 years ago
Closed 7 years ago
NSPR prevents sending 0-size UDP message on Windows
Categories
(NSPR :: NSPR, defect)
Tracking
(firefox54 fixed)
RESOLVED
FIXED
4.14
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: drno, Assigned: drno)
References
Details
Attachments
(1 file)
Over in bug 1317946 I'm trying to write a xpcshell test which sends an empty UDP packet (0 bytes payload - just the IP and UDP header) and receives it again. This works fine on Linux and Mac, but fails on Windows. The reason is that on Mac (and probably Linux as well) NSPR uses this code in NSPR allows to send an empty packet: http://searchfox.org/mozilla-central/rev/790b2cb423ea1ecb5746722d51633caec9bab95a/nsprpub/pr/src/pthreads/ptio.c#2017 But on Windows the while loop here http://searchfox.org/mozilla-central/rev/790b2cb423ea1ecb5746722d51633caec9bab95a/nsprpub/pr/src/io/prsocket.c#754 assume that there needs to be at least one byte of data to be send. This assumption is wrong for UDP. BTW the same wrong assumption is then also made here: http://searchfox.org/mozilla-central/rev/790b2cb423ea1ecb5746722d51633caec9bab95a/nsprpub/pr/src/md/windows/w95sock.c#297
Comment 1•7 years ago
|
||
MSDN agrees: https://msdn.microsoft.com/en-us/library/windows/desktop/ms740148(v=vs.85).aspx > Calling sendto with a len of zero is permissible and will return zero as a > valid value. For message-oriented sockets, a zero-length transport datagram > is sent.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → drno
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8828085 [details] Bug 1331810: enable sending of 0 size UDP packets in NSPR. https://reviewboard.mozilla.org/r/105600/#review110692 I had no idea that was a valid thing you could do, but OK. The changes are straightforward.
Attachment #8828085 -
Flags: review?(ted) → review+
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9882b8c0d5fb
Comment 6•7 years ago
|
||
You did it wrong. NSPR is a separate product, and Firefox should only use released snapshots of NSPR. Please don't make local changes to the copy of NSPR in directory /nsprpub (except when you make a try build). Instead, please suggest your changes to the NSPR component, and ask for a new NSPR snapshot to get uplifted.
Comment 7•7 years ago
|
||
reopening for landing into NSPR and fixing the target milestone.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•7 years ago
|
Target Milestone: --- → 4.14
Comment 8•7 years ago
|
||
NSPR trunk: https://hg.mozilla.org/projects/nspr/rev/271a33c4c9a4 Will land into a new NSPR 4.14 branch if things look good.
Comment 9•7 years ago
|
||
4.14 branch: https://hg.mozilla.org/projects/nspr/rev/643558f3ac5b
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•