| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 43e8650 commit b614b17
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,41 +22,52 @@ const kCurrentWriteRequest = Symbol('kCurrentWriteRequest'); | |||
| 22 | 22 | const kCurrentShutdownRequest = Symbol('kCurrentShutdownRequest'); | |
| 23 | 23 | const kPendingShutdownRequest = Symbol('kPendingShutdownRequest'); | |
| 24 | 24 | ||
| 25 | - function checkReusedHandle(self) { | ||
| 26 | - let socket = self[owner_symbol]; | ||
| 25 | + function isClosing() { | ||
| 26 | + let socket = this[owner_symbol]; | ||
| 27 | 27 | ||
| 28 | - if (socket.constructor.name === 'ReusedHandle') | ||
| 28 | + if (socket.constructor.name === 'ReusedHandle') { | ||
| 29 | 29 | socket = socket.handle; | |
| 30 | - | ||
| 31 | - return socket; | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - function isClosing() { | ||
| 35 | - const socket = checkReusedHandle(this); | ||
| 30 | + } | ||
| 36 | 31 | ||
| 37 | 32 | return socket.isClosing(); | |
| 38 | 33 | } | |
| 39 | 34 | ||
| 40 | 35 | function onreadstart() { | |
| 41 | - const socket = checkReusedHandle(this); | ||
| 36 | + let socket = this[owner_symbol]; | ||
| 37 | + | ||
| 38 | + if (socket.constructor.name === 'ReusedHandle') { | ||
| 39 | + socket = socket.handle; | ||
| 40 | + } | ||
| 42 | 41 | ||
| 43 | 42 | return socket.readStart(); | |
| 44 | 43 | } | |
| 45 | 44 | ||
| 46 | 45 | function onreadstop() { | |
| 47 | - const socket = checkReusedHandle(this); | ||
| 46 | + let socket = this[owner_symbol]; | ||
| 47 | + | ||
| 48 | + if (socket.constructor.name === 'ReusedHandle') { | ||
| 49 | + socket = socket.handle; | ||
| 50 | + } | ||
| 48 | 51 | ||
| 49 | 52 | return socket.readStop(); | |
| 50 | 53 | } | |
| 51 | 54 | ||
| 52 | 55 | function onshutdown(req) { | |
| 53 | - const socket = checkReusedHandle(this); | ||
| 56 | + let socket = this[owner_symbol]; | ||
| 57 | + | ||
| 58 | + if (socket.constructor.name === 'ReusedHandle') { | ||
| 59 | + socket = socket.handle; | ||
| 60 | + } | ||
| 54 | 61 | ||
| 55 | 62 | return socket.doShutdown(req); | |
| 56 | 63 | } | |
| 57 | 64 | ||
| 58 | 65 | function onwrite(req, bufs) { | |
| 59 | - const socket = checkReusedHandle(this); | ||
| 66 | + let socket = this[owner_symbol]; | ||
| 67 | + | ||
| 68 | + if (socket.constructor.name === 'ReusedHandle') { | ||
| 69 | + socket = socket.handle; | ||
| 70 | + } | ||
| 60 | 71 | ||
| 61 | 72 | return socket.doWrite(req, bufs); | |
| 62 | 73 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments