)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1921,"name":"Andrea Frittoli","email":"andrea.frittoli@gmail.com","username":"andrea-frittoli"},"change_message_id":"35785e7adb1fa9e9123293917b1d2ccf6d7c37d6","unresolved":false,"context_lines":[{"line_number":12,"context_line":"issues for the following RFP verification as no more RFP negotiation"},{"line_number":13,"context_line":"initial message will arrive."},{"line_number":14,"context_line":"This commit will cache the data if the above case happened. Defined"},{"line_number":15,"context_line":"a new function _rcv() which will read from the cached buff if it has"},{"line_number":16,"context_line":"data, otherwise read from the socket."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Icc3f312156b8d2cee6e0500218edf5d8b991ade7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1f013ff3_67211da0","line":15,"updated":"2017-05-13 04:11:11.000000000","message":"s/_rcv/_recv","commit_id":"9d8ea62df792d55dd191b220837af8b249113e36"}],"tempest/api/compute/servers/test_novnc.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a06299a933796d0f305482e2cbec172f902607e7","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        if self._websocket.rfp_nego_early_data is None:"},{"line_number":85,"context_line":"            data \u003d self._websocket.receive_frame()"},{"line_number":86,"context_line":"        else:"},{"line_number":87,"context_line":"            data \u003d self._websocket.rfp_nego_early_data"},{"line_number":88,"context_line":"        self.assertFalse(data is None or not data,"},{"line_number":89,"context_line":"                         \u0027Token must be invalid because the connection \u0027"},{"line_number":90,"context_line":"                         \u0027closed.\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_f8b9f5e8","line":87,"updated":"2017-05-08 09:49:54.000000000","message":"Can\u0027t this be wrapped into receive_frame?","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"72c0b9aba2cbc36e3d450bbcb314167ef5c664bb","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        if self._websocket.rfp_nego_early_data is None:"},{"line_number":85,"context_line":"            data \u003d self._websocket.receive_frame()"},{"line_number":86,"context_line":"        else:"},{"line_number":87,"context_line":"            data \u003d self._websocket.rfp_nego_early_data"},{"line_number":88,"context_line":"        self.assertFalse(data is None or not data,"},{"line_number":89,"context_line":"                         \u0027Token must be invalid because the connection \u0027"},{"line_number":90,"context_line":"                         \u0027closed.\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_aad1c5fd","line":87,"in_reply_to":"3f044301_f8b9f5e8","updated":"2017-05-09 05:31:29.000000000","message":"I didn\u0027t do that due to this first RFP frame is the only one need special handling. But agreed it\u0027s better to wrap this into the receive_frame and will do that in the next patchset.","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"}],"tempest/common/compute.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a06299a933796d0f305482e2cbec172f902607e7","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        # or no data was received (meaning the socket was closed).  This is"},{"line_number":264,"context_line":"        # done to handle the case where we get back some empty frames"},{"line_number":265,"context_line":"        while True:"},{"line_number":266,"context_line":"            header \u003d self._socket.recv(2)"},{"line_number":267,"context_line":"            # If we didn\u0027t receive any data, just return None"},{"line_number":268,"context_line":"            if not header:"},{"line_number":269,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_38a51db6","line":266,"updated":"2017-05-08 09:49:54.000000000","message":"Receive_frame could check for some data pushed back into the cache here - then return it instead of asking for more data from the socket.","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"72c0b9aba2cbc36e3d450bbcb314167ef5c664bb","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        # or no data was received (meaning the socket was closed).  This is"},{"line_number":264,"context_line":"        # done to handle the case where we get back some empty frames"},{"line_number":265,"context_line":"        while True:"},{"line_number":266,"context_line":"            header \u003d self._socket.recv(2)"},{"line_number":267,"context_line":"            # If we didn\u0027t receive any data, just return None"},{"line_number":268,"context_line":"            if not header:"},{"line_number":269,"context_line":"                return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_6ac61d4b","line":266,"in_reply_to":"3f044301_38a51db6","updated":"2017-05-09 05:31:29.000000000","message":"Only the first negotiation message/frame need special handling. that\u0027s more like the _websocket.response used by _validate_websocket_upgrade.\nBut agreed it\u0027s better to move the code reading cached frame into this function.","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a06299a933796d0f305482e2cbec172f902607e7","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        # Loop through \u0026 concatenate all of the data in the response body"},{"line_number":323,"context_line":"        end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":324,"context_line":"        while data and end_loc \u003c 0:"},{"line_number":325,"context_line":"            data \u003d self._socket.recv(4096)"},{"line_number":326,"context_line":"            self.response +\u003d data"},{"line_number":327,"context_line":"            end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":328,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_58d46920","line":325,"updated":"2017-05-08 09:49:54.000000000","message":"Is the problem that we\u0027re receiving 4k at the same time?\nIt seems that we assume that the \\r\\n\\r\\n will always occur at the *end* of a 4k chunk, but that assumption now seems invalid?","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"72c0b9aba2cbc36e3d450bbcb314167ef5c664bb","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        # Loop through \u0026 concatenate all of the data in the response body"},{"line_number":323,"context_line":"        end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":324,"context_line":"        while data and end_loc \u003c 0:"},{"line_number":325,"context_line":"            data \u003d self._socket.recv(4096)"},{"line_number":326,"context_line":"            self.response +\u003d data"},{"line_number":327,"context_line":"            end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":328,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_aac66599","line":325,"in_reply_to":"3f044301_58d46920","updated":"2017-05-09 05:31:29.000000000","message":"it\u0027s true that the response for the above upgrading HTTP request will always end up with \\r\\n\\r\\n. recv() at here will try to retrieve upto 4K data or return with all data from the socket buff if less than 4K available.  The problem at here is that RFP server will send the first message once the connection is setup, so it\u0027s possible that the data read from socket may contain this first message.","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a06299a933796d0f305482e2cbec172f902607e7","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if end_loc \u003e\u003d 0:"},{"line_number":330,"context_line":"            if len(self.response[end_loc+4:]) \u003e 2:"},{"line_number":331,"context_line":"                # In case the first RFP negotiation data has arrived."},{"line_number":332,"context_line":"                self.rfp_nego_early_data \u003d self.response[end_loc+6:]"},{"line_number":333,"context_line":"                self.response \u003d self.response[:end_loc+4]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_18b701f9","line":332,"updated":"2017-05-08 09:49:54.000000000","message":"Is this guaranteed to only be the rfp negotiation?\nI suspect we actually need all reads to go through a dummy method, and once we have an end_loc in this method we can put the remaining data in a cache that will be re-read when the next client calls?","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"72c0b9aba2cbc36e3d450bbcb314167ef5c664bb","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if end_loc \u003e\u003d 0:"},{"line_number":330,"context_line":"            if len(self.response[end_loc+4:]) \u003e 2:"},{"line_number":331,"context_line":"                # In case the first RFP negotiation data has arrived."},{"line_number":332,"context_line":"                self.rfp_nego_early_data \u003d self.response[end_loc+6:]"},{"line_number":333,"context_line":"                self.response \u003d self.response[:end_loc+4]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_2a8b751f","line":332,"in_reply_to":"3f044301_18b701f9","updated":"2017-05-09 05:31:29.000000000","message":"Per the test result, only this upgrade request is a http request and the following data is RFP frame data. And per line-270, the assumption it will only deal with frames less than 125 bytes(for RFP negotiation). So I believe the firstly RFP negotiation frame is the only one need a special handling.","commit_id":"baf3bd2c823d4bef1a80afb934ed63378e922d67"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"0629e8c1fd37e4097e1f3052210059a12cf8e508","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                self.cached_stream \u003d self.cached_stream[recv_size:]"},{"line_number":271,"context_line":"            else:"},{"line_number":272,"context_line":"                ret_data \u003d self.cached_stream + self._socket.recv(len_to_recv)"},{"line_number":273,"context_line":"            return ret_data"},{"line_number":274,"context_line":"        else:"},{"line_number":275,"context_line":"            return self._socket.recv(recv_size)"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_902076b2","line":273,"updated":"2017-05-09 08:59:03.000000000","message":"This doesn\u0027t clear cached_stream if we ask for more data than is cached.  I would also propose a simpler approach, such as:\n\nret_data \u003d \"\"\nif len(self.cached_stream)\u003e0:\n  read_from_cache \u003d min(len(self.cached_stream), recv_size)\n  ret_data +\u003d self.cached_stream[:read_from_cache]\n  self.cached_stream \u003d self.cached_stream[read_from_cache:]\n  recv_size -\u003d read_from_cached\nreturn ret_data + self._socket.recv(recv_size)","commit_id":"3020996aa19269e13a60f5509781434ecdace8b2"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f439ce03ca9259840649a82eb66b283ba2ba5dea","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                self.cached_stream \u003d self.cached_stream[recv_size:]"},{"line_number":271,"context_line":"            else:"},{"line_number":272,"context_line":"                ret_data \u003d self.cached_stream + self._socket.recv(len_to_recv)"},{"line_number":273,"context_line":"            return ret_data"},{"line_number":274,"context_line":"        else:"},{"line_number":275,"context_line":"            return self._socket.recv(recv_size)"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_5373184e","line":273,"in_reply_to":"3f044301_902076b2","updated":"2017-05-09 10:07:39.000000000","message":"oops! My fault. Thanks for having pointed it out.","commit_id":"3020996aa19269e13a60f5509781434ecdace8b2"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"0629e8c1fd37e4097e1f3052210059a12cf8e508","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            self.response +\u003d data"},{"line_number":344,"context_line":"            end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"        if len(self.response[end_loc + 4:]) \u003e 0:"},{"line_number":347,"context_line":"            # In case some frames (e.g. the first RFP negotiation) have"},{"line_number":348,"context_line":"            # arrived, cache it for next reading."},{"line_number":349,"context_line":"            self.cached_stream \u003d self.response[end_loc + 4:]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_101ea66f","line":346,"updated":"2017-05-09 08:59:03.000000000","message":"This is a bit weird - I\u0027d say if len(self.response) \u003e end_loc+4","commit_id":"3020996aa19269e13a60f5509781434ecdace8b2"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f439ce03ca9259840649a82eb66b283ba2ba5dea","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            self.response +\u003d data"},{"line_number":344,"context_line":"            end_loc \u003d self.response.find(b\u0027\\r\\n\\r\\n\u0027)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"        if len(self.response[end_loc + 4:]) \u003e 0:"},{"line_number":347,"context_line":"            # In case some frames (e.g. the first RFP negotiation) have"},{"line_number":348,"context_line":"            # arrived, cache it for next reading."},{"line_number":349,"context_line":"            self.cached_stream \u003d self.response[end_loc + 4:]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_13935051","line":346,"in_reply_to":"3f044301_101ea66f","updated":"2017-05-09 10:07:39.000000000","message":"Done","commit_id":"3020996aa19269e13a60f5509781434ecdace8b2"}]}
