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

Use HTTP/1.1 #617

Merged
merged 1 commit into from
Oct 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tensorboard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ def main(unused_argv=None):
efi.inspect(FLAGS.logdir, event_file, FLAGS.tag)
return 0
else:

# The default is HTTP/1.0 for some strange reason. If we don't use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the BasicHTTPRequestHandler docs say it's to keep people from shooting themselves in the foot by omitting Content-Length:
https://docs.python.org/2/library/basehttpserver.html#BaseHTTPServer.BaseHTTPRequestHandler.protocol_version

But yeah, it seems like HTTP/1.1 should be the default and BaseHTTPRequestHandler should just die on you if you attempt to send a response with no content length.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

# HTTP/1.1 then a new TCP socket and Python thread is created for
# each HTTP request. The tradeoff is we must always specify the
# Content-Length header, or do chunked encoding for streaming.
serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'

plugins = [
core_plugin.CorePlugin,
scalars_plugin.ScalarsPlugin,
Expand Down