multicall.py 文件源码

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

项目:taf 作者: taf3 项目源码 文件源码
def _test_env_var_size():
    # max seems to be 1024 * 127
    """Private function to verify the maximum command line payload size.

    This should be smatter and bisect, but it doesn't

    """
    for f in range(256, 100, -1):
        payload = 'a' * 1024 * f
        try:
            cmd = ["ssh", "-t"] + sys.argv[1:] +\
                  ["wc -c  <<<'{}' ; sleep 0.2 ; exit".format(payload)]
            if call(cmd) == 0:
                print("%s is good" % f)
                print(len(payload))
                break
        except OSError as e:
            if e.errno == errno.E2BIG:
                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号