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

Error on piping a request to a destination #31

Merged
merged 1 commit into from May 25, 2011

Conversation

Projects
None yet
2 participants
@tobowers
Copy link
Contributor

commented May 12, 2011

i was getting a weird error using the master branch of request and sending it to a file:

TypeError: Cannot call method 'apply' of undefined
    at [object Object].resume (/Users/topper/Sites/snap/javascript-openstack-object/lib/request.js:310:19)
    at [object Object].ondrain (stream.js:43:33)
    at [object Object].emit (events.js:61:17)
    at [object Object].flush (fs.js:1010:32)
    at fs.js:1051:10
    at wrapper (fs.js:295:17)

I changed pause and resume to operate on response instead of request. However, I'm not sure if there will be any consequences to the change.

@mikeal

This comment has been minimized.

Copy link
Member

commented May 24, 2011

my brain hurts, but i think this is correct.

Request is a duplexed read/write stream. pause() and resume() are for readable streams, when the Request stream is being read it's in relation to the HTTP response, not the HTTP request, so I think this is all right.

Did you happen to run test/test-pipes?

@tobowers

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2011

yup - says "All tests passed." - but the tests don't actually check for pause/resume. However - I think we're right that pause/resume should only happen on response.

@mikeal

This comment has been minimized.

Copy link
Member

commented May 25, 2011

i'm gonna merge this today and write a test for it sometime this week before i release.

mikeal added a commit that referenced this pull request May 25, 2011

Merge pull request #31 from tobowers/master
Error on piping a request to a destination

@mikeal mikeal merged commit 53e7ad0 into request:master May 25, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.