{"action":"created","comment":{"url":"https://api.github.com/repos/tlake/http-server/pulls/comments/33878294","id":33878294,"diff_hunk":"@@ -117,3 +162,28 @@ def run_server():\n \n if __name__ == \"__main__\":\n     run_server()\n+\n+\"\"\"RESP = (\"HTTP/1.1 200 OK\"\n+        \"Content-Type: text/plain\"\n+        \"\"\n+        \"hello\")\n+\n+\n+def echo(socket, address):\n+    buffsize = 16\n+    while True:\n+        data = socket.recv(buffsize)\n+        if len(data) < buffsize:\n+            socket.sendall(RESP)\n+        else:\n+            socket.close()\n+            break\n+\n+\n+if __name__ == '__main__':\n+    from gevent.server import StreamServer\n+    from gevent.monkey import patch_all\n+    patch_all()\n+    server = StreamServer(('127.0.0.1', 8000), echo)\n+    print(\"starting server\")\n+\"\"\"","path":"server.py","position":200,"original_position":200,"commit_id":"963b950977a22a39a5b6622e0ce15e74d5ba4fa3","original_commit_id":"963b950977a22a39a5b6622e0ce15e74d5ba4fa3","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"what is all this about?  Notes from class?","created_at":"2015-07-03T19:17:23Z","updated_at":"2015-07-03T19:17:23Z","html_url":"https://github.com/tlake/http-server/pull/3#discussion_r33878294","pull_request_url":"https://api.github.com/repos/tlake/http-server/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/tlake/http-server/pulls/comments/33878294"},"html":{"href":"https://github.com/tlake/http-server/pull/3#discussion_r33878294"},"pull_request":{"href":"https://api.github.com/repos/tlake/http-server/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/tlake/http-server/pulls/3","id":39142061,"html_url":"https://github.com/tlake/http-server/pull/3","diff_url":"https://github.com/tlake/http-server/pull/3.diff","patch_url":"https://github.com/tlake/http-server/pull/3.patch","issue_url":"https://api.github.com/repos/tlake/http-server/issues/3","number":3,"state":"closed","locked":false,"title":"Step3","user":{"login":"tlake","id":5035800,"avatar_url":"https://avatars.githubusercontent.com/u/5035800?v=3","gravatar_id":"","url":"https://api.github.com/users/tlake","html_url":"https://github.com/tlake","followers_url":"https://api.github.com/users/tlake/followers","following_url":"https://api.github.com/users/tlake/following{/other_user}","gists_url":"https://api.github.com/users/tlake/gists{/gist_id}","starred_url":"https://api.github.com/users/tlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlake/subscriptions","organizations_url":"https://api.github.com/users/tlake/orgs","repos_url":"https://api.github.com/users/tlake/repos","events_url":"https://api.github.com/users/tlake/events{/privacy}","received_events_url":"https://api.github.com/users/tlake/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-03T02:41:17Z","updated_at":"2015-07-03T19:17:23Z","closed_at":"2015-07-03T02:41:47Z","merged_at":"2015-07-03T02:41:47Z","merge_commit_sha":"1a1e6fde79c83d054589536621b429e025319d36","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tlake/http-server/pulls/3/commits","review_comments_url":"https://api.github.com/repos/tlake/http-server/pulls/3/comments","review_comment_url":"https://api.github.com/repos/tlake/http-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tlake/http-server/issues/3/comments","statuses_url":"https://api.github.com/repos/tlake/http-server/statuses/963b950977a22a39a5b6622e0ce15e74d5ba4fa3","head":{"label":"tlake:step3","ref":"step3","sha":"963b950977a22a39a5b6622e0ce15e74d5ba4fa3","user":{"login":"tlake","id":5035800,"avatar_url":"https://avatars.githubusercontent.com/u/5035800?v=3","gravatar_id":"","url":"https://api.github.com/users/tlake","html_url":"https://github.com/tlake","followers_url":"https://api.github.com/users/tlake/followers","following_url":"https://api.github.com/users/tlake/following{/other_user}","gists_url":"https://api.github.com/users/tlake/gists{/gist_id}","starred_url":"https://api.github.com/users/tlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlake/subscriptions","organizations_url":"https://api.github.com/users/tlake/orgs","repos_url":"https://api.github.com/users/tlake/repos","events_url":"https://api.github.com/users/tlake/events{/privacy}","received_events_url":"https://api.github.com/users/tlake/received_events","type":"User","site_admin":false},"repo":{"id":38272014,"name":"http-server","full_name":"tlake/http-server","owner":{"login":"tlake","id":5035800,"avatar_url":"https://avatars.githubusercontent.com/u/5035800?v=3","gravatar_id":"","url":"https://api.github.com/users/tlake","html_url":"https://github.com/tlake","followers_url":"https://api.github.com/users/tlake/followers","following_url":"https://api.github.com/users/tlake/following{/other_user}","gists_url":"https://api.github.com/users/tlake/gists{/gist_id}","starred_url":"https://api.github.com/users/tlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlake/subscriptions","organizations_url":"https://api.github.com/users/tlake/orgs","repos_url":"https://api.github.com/users/tlake/repos","events_url":"https://api.github.com/users/tlake/events{/privacy}","received_events_url":"https://api.github.com/users/tlake/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tlake/http-server","description":"","fork":false,"url":"https://api.github.com/repos/tlake/http-server","forks_url":"https://api.github.com/repos/tlake/http-server/forks","keys_url":"https://api.github.com/repos/tlake/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tlake/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tlake/http-server/teams","hooks_url":"https://api.github.com/repos/tlake/http-server/hooks","issue_events_url":"https://api.github.com/repos/tlake/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/tlake/http-server/events","assignees_url":"https://api.github.com/repos/tlake/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/tlake/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/tlake/http-server/tags","blobs_url":"https://api.github.com/repos/tlake/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tlake/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tlake/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/tlake/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tlake/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/tlake/http-server/languages","stargazers_url":"https://api.github.com/repos/tlake/http-server/stargazers","contributors_url":"https://api.github.com/repos/tlake/http-server/contributors","subscribers_url":"https://api.github.com/repos/tlake/http-server/subscribers","subscription_url":"https://api.github.com/repos/tlake/http-server/subscription","commits_url":"https://api.github.com/repos/tlake/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/tlake/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/tlake/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/tlake/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/tlake/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/tlake/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tlake/http-server/merges","archive_url":"https://api.github.com/repos/tlake/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tlake/http-server/downloads","issues_url":"https://api.github.com/repos/tlake/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/tlake/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/tlake/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/tlake/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tlake/http-server/labels{/name}","releases_url":"https://api.github.com/repos/tlake/http-server/releases{/id}","created_at":"2015-06-29T21:21:18Z","updated_at":"2015-06-30T02:20:49Z","pushed_at":"2015-07-03T19:11:54Z","git_url":"git://github.com/tlake/http-server.git","ssh_url":"git@github.com:tlake/http-server.git","clone_url":"https://github.com/tlake/http-server.git","svn_url":"https://github.com/tlake/http-server","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tlake:master","ref":"master","sha":"1f86525a5a523cf764dabef2f3ef87430419f77a","user":{"login":"tlake","id":5035800,"avatar_url":"https://avatars.githubusercontent.com/u/5035800?v=3","gravatar_id":"","url":"https://api.github.com/users/tlake","html_url":"https://github.com/tlake","followers_url":"https://api.github.com/users/tlake/followers","following_url":"https://api.github.com/users/tlake/following{/other_user}","gists_url":"https://api.github.com/users/tlake/gists{/gist_id}","starred_url":"https://api.github.com/users/tlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlake/subscriptions","organizations_url":"https://api.github.com/users/tlake/orgs","repos_url":"https://api.github.com/users/tlake/repos","events_url":"https://api.github.com/users/tlake/events{/privacy}","received_events_url":"https://api.github.com/users/tlake/received_events","type":"User","site_admin":false},"repo":{"id":38272014,"name":"http-server","full_name":"tlake/http-server","owner":{"login":"tlake","id":5035800,"avatar_url":"https://avatars.githubusercontent.com/u/5035800?v=3","gravatar_id":"","url":"https://api.github.com/users/tlake","html_url":"https://github.com/tlake","followers_url":"https://api.github.com/users/tlake/followers","following_url":"https://api.github.com/users/tlake/following{/other_user}","gists_url":"https://api.github.com/users/tlake/gists{/gist_id}","starred_url":"https://api.github.com/users/tlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlake/subscriptions","organizations_url":"https://api.github.com/users/tlake/orgs","repos_url":"https://api.github.com/users/tlake/repos","events_url":"https://api.github.com/users/tlake/events{/privacy}","received_events_url":"https://api.github.com/users/tlake/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tlake/http-server","description":"","fork":false,"url":"https://api.github.com/repos/tlake/http-server","forks_url":"https://api.github.com/repos/tlake/http-server/forks","keys_url":"https://api.github.com/repos/tlake/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tlake/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tlake/http-server/teams","hooks_url":"https://api.github.com/repos/tlake/http-server/hooks","issue_events_url":"https://api.github.com/repos/tlake/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/tlake/http-server/events","assignees_url":"https://api.github.com/repos/tlake/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/tlake/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/tlake/http-server/tags","blobs_url":"https://api.github.com/repos/tlake/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tlake/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tlake/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/tlake/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tlake/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/tlake/http-server/languages","stargazers_url":"https://api.github.com/repos/tlake/http-server/stargazers","contributors_url":"https://api.github.com/repos/tlake/http-server/contributors","subscribers_url":"https://api.github.com/repos/tlake/http-server/subscribers","subscription_url":"https://api.github.com/repos/tlake/http-server/subscription","commits_url":"https://api.github.com/repos/tlake/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/tlake/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/tlake/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/tlake/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/tlake/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/tlake/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tlake/http-server/merges","archive_url":"https://api.github.com/repos/tlake/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tlake/http-server/downloads","issues_url":"https://api.github.com/repos/tlake/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/tlake/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/tlake/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/tlake/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tlake/http-server/labels{/name}","releases_url":"https://api.github.com/repos/tlake/http-server/releases{/id}","created_at":"2015-06-29T21:21:18Z","updated_at":"2015-06-30T02:20:49Z","pushed_at":"2015-07-03T19:11:54Z","git_url":"git://github.com/tlake/http-server.git","ssh_url":"git@github.com:tlake/http-server.git","clone_url":"https://github.com/tlake/http-server.git","svn_url":"https://github.com/tlake/http-server","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tlake/http-server/pulls/3"},"html":{"href":"https://github.com/tlake/http-server/pull/3"},"issue":{"href":"https://api.github.com/repos/tlake/http-server/issues/3"},"comments":{"href":"https://api.github.com/repos/tlake/http-server/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/tlake/http-server/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/tlake/http-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tlake/http-server/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/tlake/http-server/statuses/963b950977a22a39a5b6622e0ce15e74d5ba4fa3"}}}}