Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't manage to push multiple requests #164

Closed
akc42 opened this issue Jan 6, 2016 · 1 comment
Closed

Can't manage to push multiple requests #164

akc42 opened this issue Jan 6, 2016 · 1 comment

Comments

@akc42
Copy link
Contributor

akc42 commented Jan 6, 2016

I have tried a variety of ways to send a list of 21 files in a push request. But it seems that somewhere something is ending causing the server to crash

/home/alan/dev/node-http2/lib/protocol/stream.js:627
      throw new Error('Sending illegal frame (' + frame.type + ') in ' + this.state + ' state.');
      ^

Error: Sending illegal frame (DATA) in CLOSED state.
    at Stream.transition [as _transition] (/home/alan/dev/node-http2/lib/protocol/stream.js:627:13)
    at Stream._pushUpstream (/home/alan/dev/node-http2/lib/protocol/stream.js:230:8)
    at Stream._finishing (/home/alan/dev/node-http2/lib/protocol/stream.js:351:10)
    at emitNone (events.js:67:13)
    at Stream.emit (events.js:166:7)
    at finishMaybe (_stream_writable.js:468:14)
    at endWritable (_stream_writable.js:478:3)
    at Stream.Writable.end (_stream_writable.js:443:5)
    at OutgoingResponse._finish (/home/alan/dev/node-http2/lib/http.js:355:17)
    at emitNone (events.js:72:20)

I go through a process which gives me an array of objects with the push url and filename in each object. My code is

        if(req.url === '/' || req.url === '/index.html') {
          if(res.push) {
            pushlist.forEach(item=> {
              var p = res.push(item.url)
              p.writeHead(200);
              fs.createReadStream(item.filename).pipe(p);
            })
          }
        }
        router(req,res,donewrapper);

the router(req,res,donewrapper); goes on to server index.html via serve-static.

without the push stuff, the server works perfectly - and single stepping through the initialisation of each of the file readstreams also seems to work. It is only later when one of the streams end (see how OutgoingResponse._finish is at the bottom of the call stack) that this happens.

I don't know where to go next.

@nwgh
Copy link
Collaborator

nwgh commented Jan 8, 2016

This looks like a duplicate of #107 (the stack is exactly the same). I suspect your client is sending a RST_STREAM for one or more of the pushes, for some reason or another.

@nwgh nwgh closed this as completed Jan 8, 2016
@nwgh nwgh added the duplicate label Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants