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

hang on read of 0-byte file #65

Open
GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments
Open

hang on read of 0-byte file #65

GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. attempt to cat a 0-byte file
2.
3.

What is the expected output? What do you see instead?

When cat'ing a 0-byte file, I am expecting the cat to return immediately with 
nothing displayed on the terminal.  Instead, the cat appears to hang until some 
timeout is reached.


What version of the product are you using? On what operating system?

pywebdav 0.9.8 with python 2.7.2 on mac os x mountain lion


Please provide any additional information below.

A workaround is to disable chunked responses (e.g. with '-T'), thus I think the 
chunked response code does not handle 0-byte files properly.  I think that the 
chunked response code sends a poorly formatted chunk to the client that causes 
the client to think that more data is coming.  I worked around this by adding a 
"not DATA" condition to the "if" in send_body_chunks_if_http11() (basically, 
avoid send_body_chunks() if DATA is empty).


Original issue reported on code.google.com by [email protected] on 29 Jan 2013 at 5:20

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

1 participant