Commit Graph
26 Commits
Author SHA1 Message Date
Sylvestre Ledru a22215a2f9 Bug 2023419 - Remove Emacs/Vim modelines from netwerk/ r=emilio,cookie-reviewers,valentin
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287861
2026-03-17 12:06:31 +00:00
Lars Eggert e168a316b1 Bug 2020268 - Coalesce PollableEvent notifications on Windows. r=valentin,kershaw,necko-reviewers
Remove the `#ifndef XP_WIN` guards in `PollableEvent::Signal()` and `OnDispatchedEvent()`, making both optimizations unconditional:

- Socket-thread early return: when `Signal()` is called on the socket thread, the thread is not blocked in `PR_Poll`, so there is nothing to wake up.
- `mSignaled` flag: if a byte is already pending in the TCP pair, the socket thread will drain all queued events when it wakes, so additional writes are redundant.

Add a bool `aForce` parameter to `Signal()` so that `DoPollRepair()` can bypass coalescing when the shutdown watchdog detects a stuck `PR_Poll`.

Differential Revision: https://phabricator.services.mozilla.com/D285461
2026-03-02 22:01:11 +00:00
Emilio Cobos Álvarez 6a9374258b Bug 2014945 - Avoid \n in NS_WARNING. r=stransky,necko-reviewers,webrtc-reviewers,dbaker
It is not needed and makes the warning filename and so on show up in a
different line.

Differential Revision: https://phabricator.services.mozilla.com/D282098
2026-02-06 08:45:22 +00:00
Valentin Gosu 4afd0a9077 Bug 1995267 - Workaround for 1993248 - mark PRFileDesc nonblocking to avoid hanging in PollableEvent::Clear r=necko-reviewers,jesup
Even though calling Clear should only be done when we get non-null out_flags for the socket pair
it should still never block. However, when the socket pair is created by PR_CreatePipe the
PRFileDesc don't properly get their `fd->secret->nonblocking = true` set, so PR_Read might
actually block. This is a workaround until bug 1993248 fixes the issue in NSPR

Differential Revision: https://phabricator.services.mozilla.com/D269201
2025-10-23 09:50:35 +00:00
serge-sans-paille f56a268ae0 Bug 1733356 - Fix non-unified build errors in netwerk/ r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D170852
2023-02-28 10:20:16 +00:00
Valentin Gosu 9560d62d63 Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-11 07:10:41 +00:00
Csoregi Natalia e88581b300 Backed out changeset 6e00f8bd2acc (bug 1714307) for causing hazard bustage. CLOSED TREE 2021-06-09 21:50:03 +03:00
Valentin Gosu c01e585de7 Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-09 10:20:04 +00:00
Sylvestre Ledru ad31adba4c Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956
2019-05-01 08:47:10 +00:00
Dorel Luca d252cdd39a Backed out 2 changesets (bug 1516325) for xpcshell failures in netwerk/test/unit/test_udpsocket.js. CLOSED TREE
Backed out changeset 7f9508dc59e1 (bug 1516325)
Backed out changeset 28eb88277ffc (bug 1516325)
2019-03-06 20:51:39 +02:00
Jed Davis 78eb5f1be9 Bug 1516325 - Don't poll for POLLPRI on Necko self-pipe on Unix. r=dragana
Necko uses a pipe-to-self pattern in its event loop, except that on
Windows the pipe is a socket, and we're checking for PR_POLL_EXCEPT for
Windows-specific reasons and treating it as an error.  On Unix this
isn't necessary, and it causes interoperability problems with MacOS,
which asserts POLLPRI (which is what PR_POLL_EXCEPT maps to) as well
as POLLIN on pipes whenever normal data can be read.  (This may be a
standards violation by MacOS, but it's simple enough to work around.)

Differential Revision: https://phabricator.services.mozilla.com/D21321
2019-03-04 15:39:15 +00:00
Ehsan Akhgari 498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Honza Bambas 972b634098 Bug 1442178 - Repair broken socket polling wakeup mechanism after a network change to prevent long load hangs, r=dragana 2018-05-30 17:31:09 +03:00
Kris Maglione f32ed7e237 Bug 1455446: Set CLOEXEC on socket FDs. r=dragana
MozReview-Commit-ID: L617m03Z3RS
2018-04-19 14:23:25 -07:00
Nathan Froyd a3cd9ee75a Bug 1360236 - make gSocketThread an internal implementation detail of nsSocketTransportService; r=mcmanus
This change makes the code a little cleaner and reduces the number of
places we call PR_GetCurrentThread, which is important for Quantum DOM
scheduling work.

The conversion was largely automatic, via:

find netwerk/ -name \*.cpp | \
  xargs sed -i -e 's/MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread[^;]*/MOZ_ASSERT(OnSocketThread(), "not on socket thread")/'

and related invocations, with a few manual tweaks at the end.
2017-04-27 14:34:42 -04:00
195984fbcf Bug 1305436 - "Fix issue with Firefox 49 won't start after installation". r=mcmanus 2016-10-06 09:22:00 +02:00
Dragana Damjanovic 05a4451739 Bug 1292181 - Let each dispatch event sends data to the socket. r=mcmanus yolo CLOSED TREE 2016-08-11 16:30:23 -07:00
18f6ef2e06 Bug 1270029 - Set mSignaled only if PR_Write succeeds. r=mcmanus 2016-05-04 01:29:00 -04:00
Patrick McManus d1e5396343 Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-03-22 11:02:39 -04:00
Patrick McManus fe03a14da2 Bug 698882 - backout 34046c232ee1 r=backout 2016-03-23 13:06:02 -04:00
Patrick McManus 98daa85580 Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-03-22 11:02:39 -04:00
Phil Ringnalda cb131da50b Back out changeset 06e41d2080a2 (bug 698882) for (at least) 10.6 leaks including PollableEvent
CLOSED TREE
2016-03-20 17:24:48 -07:00
Patrick McManus 6f9cb5886d Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-02-11 15:00:22 -05:00
Patrick McManus ab7c6ebead Bug 698882 - backout threadevent changes due to crashes with McAfee Firefox Hook r=backout 2016-02-21 17:41:21 -05:00
Patrick McManus 8bcce717c3 Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-02-11 15:00:22 -05:00