parameters: (handler)
return_statement: return int(content_length)
docstring: 从响应句柄中获取文本数据大小
docstring_summary: 从响应句柄中获取文本数据大小
docstring_tokens: 从响应句柄中获取文本数据大小
function: def get_content_length_from_handler(handler):
      """
      从响应句柄中获取文本数据大小
      """
      content_length = handler.headers.get('content-length', None)
      if not content_length:
          err = 'failed to get "content-length" in respone headers'
          raise MonitorDownloadError(err)
  
      return int(content_length)
function_tokens: def get_content_length_from_handler ( handler ) : content_length = handler . headers . get ( 'content-length' , None ) if not content_length : err = 'failed to get "content-length" in respone headers' raise MonitorDownloadError ( err ) return int ( content_length )