Sindbad~EG File Manager
�
��g' � �2 � d dl Z ddlmZmZmZmZ d� Zd� ZdS )� N� )�LogLevel�log� log_stack�start_threadc �� � d} | � � � }t |� � dk rt d� � dS |� � � }|dk rnT|� d� � r,|dd� � � � }t |� � }��t d|z � � ��t
� � }t |� � |k ra| � |t |� � z
� � }t |� � dk rt d � � dS ||z
}t |� � |k �at j |� � S # t $ r t t j
� � Y dS w xY w)
zeRead a JSON-RPC message from STREAM.
The decoded object is returned.
None is returned on EOF.NTr �EOF� s Content-Length:� zIGNORED: <<<%s>>>zEOF after reading the header)�readline�lenr �strip�
startswith�int�bytes�read�json�loads�OSErrorr r �FULL)�stream�content_length�line�data�new_datas �./gdb/dap/io.py� read_jsonr sk � ����
,��?�?�$�$�D��4�y�y�A�~�~��E�
�
�
��t��:�:�<�<�D��s�{�{�����1�2�2�
��B�C�C�y���(�(��!$�T������#�d�*�+�+�+�
,� �w�w���$�i�i�.�(�(��{�{�>�C��I�I�#=�>�>�H��8�}�}��!�!��2�3�3�3��t��H��D�
�$�i�i�.�(�(� �z�$������ � � � �(�-� � � ��t�t� ���s �9E �CE �+E �#E)�(E)c �2 � �� �� fd�}t d|� � S )z�Start the JSON writer thread.
It will read objects from QUEUE and write them to STREAM,
following the JSON-RPC protocol.c � �� d} �� � � }|�d S | |d<