abort request instead of trying to destroy its connection
This commit is contained in:
parent
9a9bd308ce
commit
1152d61c06
3 changed files with 4 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ Use-cases
|
|||
Installation
|
||||
------------
|
||||
You need to have Node.JS >= 0.10.0 installed on your system.
|
||||
|
||||
```$ npm install -g catalyst-proxy```
|
||||
|
||||
To update:
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@ module.exports = class Request extends Duplex
|
|||
called = true
|
||||
|
||||
if streaming
|
||||
console.log 'STREAM', @length, @range
|
||||
console.log 'STREAM', (url.format @reqOpts), @length, @range
|
||||
@_streamingMode()
|
||||
else
|
||||
console.log 'THROUGH', (url.format @reqOpts), @length, @range
|
||||
thread.on 'end', => @stream.end()
|
||||
thread.on 'disconnect', => @stream.end()
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ module.exports = class Thread extends Duplex
|
|||
|
||||
@_req.removeAllListeners()
|
||||
@_req.on 'error', (e) -> console.log 'req error', e # Dummy error listener
|
||||
@_req.connection.destroy()
|
||||
@_req.abort()
|
||||
|
||||
if @_res
|
||||
@_res.removeAllListeners()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue