def pack_len(s):
        l = len(s)
        if l < 128:
            return chr(l)
        elif l > 0x7fffffff:
            raise ValueError('Maximum name or value length is {0}'.format(
                0x7fffffff))
        return length_struct.pack(l | 0x80000000)
dataset/ETHPy150Open momyc/gevent-fastcgi/gevent_fastcgi/utils.py/pack_len/original