throttle.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Intranet-Penetration 作者: yuxiaokui 项目源码 文件源码
def _CalculateRequestSize(self, req):
    """Calculates the request size.

    Args:
      req: A tuple of (uri, method name, request body, header map)
    Returns:
      the size of the request, in bytes.
    """
    uri, method, body, headers = req
    (unused_scheme,
     unused_host_port, url_path,
     unused_query, unused_fragment) = urlparse.urlsplit(uri)
    size = len('%s %s HTTP/1.1\n' % (method, url_path))
    size += self._CalculateHeaderSize(headers)


    if body:
      size += len(body)
    return size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号