| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
The else branch is unnecessary. You're returning the same thing in both branches.
Sorry, something went wrong.
There was a problem hiding this comment.
oh yeah, will fix that
Sorry, something went wrong.
|
@nodejs/http |
Sorry, something went wrong.
|
+1 to @cjihrig's comment. Once that is addressed this should be good. |
Sorry, something went wrong.
There was a problem hiding this comment.
Why change the name?
Sorry, something went wrong.
There was a problem hiding this comment.
It used to be optionsPath since the only option was the path. With this change we introduce non-path related options in there, which is why I felt renaming would make sense and I've chosen createConnectionOptions since we pass them to the createConnection function.
Sorry, something went wrong.
There was a problem hiding this comment.
To me optionsPath is more general, like 'options for (unix) socket path' as opposed to 'options for TCP socket'. With that in mind, I'd prefer to see the name unchanged. If other @nodejs/collaborators disagree, at the very least I'd rather see a more succinct name like connectOptions or createOptions or similar.
Sorry, something went wrong.
There was a problem hiding this comment.
I think a shorter name is better.
Sorry, something went wrong.
There was a problem hiding this comment.
I see what you mean @mscdex . I think it's ok to go back to optionsPath then.
Sorry, something went wrong.
|
Some nits (same as @mscdex), but LGTM for me. |
Sorry, something went wrong.
|
Labeling in progress because it needs a test. |
Sorry, something went wrong.
|
It also needs a documentation update |
Sorry, something went wrong.
|
I've changed everything as discussed. I also noticed that we wouldn't emit a timeout event. To make it consistent with setTimeout - which does emit a timeout event - and to make it easier to test, I added that functionality. I've also added a test and updated the docs. |
Sorry, something went wrong.
There was a problem hiding this comment.
Minor nit, but to be consistent we could just reference self.timeout here instead.
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed it
Sorry, something went wrong.
There was a problem hiding this comment.
Why not simply:
if (req.timeout)
socket.once('timeout', () => req.emit('timeout'));
Sorry, something went wrong.
|
Few additional nits. Almost there! |
Sorry, something went wrong.
|
I've fixed all the mentioned issues except for the req error handling one, which I commentent on. I've also applied the fixes to test-http-client-timeout-event, which I based my test off of, so it that is consistent. |
Sorry, something went wrong.
|
LGTM if CI is green. |
Sorry, something went wrong.
|
Shouldn't the timeout option be documented in the net module too? |
Sorry, something went wrong.
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting Fixes nodejs#7580
|
True, I've added it now to the net documentation |
Sorry, something went wrong.
Sorry, something went wrong.
|
Removing in-progress label, because test has been implemented. |
Sorry, something went wrong.
|
From the implementation point of view it should be fine. The only thing is that I got no feedback on, yet, are the doc changes, specifically for the net docs. Unless there are any objection there, it should be good to go. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
I'm counting three LGTMs and no clear objections for landing this. CI tests have passed. I've assigned this to myself for landing prep, but I'd like to hold until monday to give everyone time to comment. |
Sorry, something went wrong.
|
I'll start landing this:
|
Sorry, something went wrong.
Sorry, something went wrong.
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101 Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101 Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: nodejs#8101 Fixes: nodejs#7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101 Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) #8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) #8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) #8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) #8100 * npm: Upgraded to 3.10.8 (Kat Marchán) #8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) #8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) #8661 PR-URL: #9034
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) #8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) #8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) #8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) #8100 * npm: Upgraded to 3.10.8 (Kat Marchán) #8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) #8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) #8661 PR-URL: #9034
* fs:
- `SyncWriteStream` now inherits from `Stream.Writable`. (Anna
Henningsen) nodejs/node#8830
- Practically, this means that when stdio is piped to a file,
stdout and stderr will still be `Writable` streams.
- `fs.existsSync()` has been undeprecated. `fs.exists()` remains
deprecated. (Dan Fabulich) nodejs/node#8364
* http: `http.request()` now accepts a `timeout` option. (Rene Weber)
nodejs/node#8101
* module: The module loader now maintains its own realpath cache. (Anna
Henningsen) nodejs/node#8100
* npm: Upgraded to 3.10.8 (Kat Marchan)
nodejs/node#8706
* stream: `Duplex` streams now show proper `instanceof
Stream.Writable`. (Anna Henningsen)
nodejs/node#8834
* timers: Improved `setTimeout`/`Interval` performance by up to 22%.
(Brian White) nodejs/node#8661
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
* fs:
- `SyncWriteStream` now inherits from `Stream.Writable`. (Anna
Henningsen) nodejs/node#8830
- Practically, this means that when stdio is piped to a file,
stdout and stderr will still be `Writable` streams.
- `fs.existsSync()` has been undeprecated. `fs.exists()` remains
deprecated. (Dan Fabulich) nodejs/node#8364
* http: `http.request()` now accepts a `timeout` option. (Rene Weber)
nodejs/node#8101
* module: The module loader now maintains its own realpath cache. (Anna
Henningsen) nodejs/node#8100
* npm: Upgraded to 3.10.8 (Kat Marchan)
nodejs/node#8706
* stream: `Duplex` streams now show proper `instanceof
Stream.Writable`. (Anna Henningsen)
nodejs/node#8834
* timers: Improved `setTimeout`/`Interval` performance by up to 22%.
(Brian White) nodejs/node#8661
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
|
Can the people who authored/reviewed this comment on #12005? It's unclear if the code actually does what the documentation suggests it does. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@bnoordhuis to the best of my knowledge, it does what is supposed to be doing. The doc is definitely not clear in what is happening. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
http, net
Description of change
This allows passing the socket connection timeout to http#request
such that it will be set before the socket is connecting
Fixes #7580