{"action":"opened","issue":{"url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/78","labels_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/78/comments","events_url":"https://api.github.com/repos/python-hyper/hyper-h2/issues/78/events","html_url":"https://github.com/python-hyper/hyper-h2/issues/78","id":125593717,"number":78,"title":"Fix leaking ValueError from hyperframe.","user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-08T11:29:50Z","updated_at":"2016-01-08T11:29:50Z","closed_at":null,"body":"Hyperframe emits a ValueError when invalid values in the stream header are found. Hyper-h2 does tear the connection down when that happens, but it doesn't really handle it properly and lets the exception leak instead of raising a ProtocolError. We should fix that.\r\n\r\nFound when using h2spec.\r\n\r\nExample traceback:\r\n\r\n```\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/internet/tcp.py\", line 215, in _dataReceived\r\n\t    rval = self.protocol.dataReceived(data)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/protocols/tls.py\", line 422, in dataReceived\r\n\t    self._flushReceiveBIO()\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/protocols/tls.py\", line 392, in _flushReceiveBIO\r\n\t    ProtocolWrapper.dataReceived(self, bytes)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/protocols/policies.py\", line 120, in dataReceived\r\n\t    self.wrappedProtocol.dataReceived(data)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/web/http.py\", line 2093, in dataReceived\r\n\t    return self._obj.dataReceived(data)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/twisted/web/http2.py\", line 92, in dataReceived\r\n\t    events = self.conn.receive_data(data)\r\n\t  File \"/Users/cory/Documents/Python/hyper-h2/h2/connection.py\", line 700, in receive_data\r\n\t    for frame in self.incoming_buffer:\r\n\t  File \"/Users/cory/Documents/Python/hyper-h2/h2/frame_buffer.py\", line 53, in next\r\n\t    f, length = Frame.parse_frame_header(self.data[:9])\r\n\t  File \"/Users/cory/Documents/Python/Twisted/build/lib/python2.7/site-packages/hyperframe/frame.py\", line 86, in parse_frame_header\r\n\t    frame = FRAMES[type](stream_id)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/build/lib/python2.7/site-packages/hyperframe/frame.py\", line 220, in __init__\r\n\t    super(DataFrame, self).__init__(stream_id, **kwargs)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/build/lib/python2.7/site-packages/hyperframe/frame.py\", line 147, in __init__\r\n\t    super(Padding, self).__init__(stream_id, **kwargs)\r\n\t  File \"/Users/cory/Documents/Python/Twisted/build/lib/python2.7/site-packages/hyperframe/frame.py\", line 52, in __init__\r\n\t    raise ValueError('Stream ID must be non-zero')\r\n\texceptions.ValueError: Stream ID must be non-zero\r\n```"}}