def serialize_requests(g):
    for (common_name, path, buf, req, submitted, server) in g():
        try:
            submission_address = getxattr(path, 'user.request.address').decode('ascii')
        except IOError:
            submission_address = None
        try:
            submission_hostname = getxattr(path, 'user.request.hostname').decode('ascii')
        except IOError:
            submission_hostname = None
        (yield dict(submitted=submitted, common_name=common_name, address=submission_address, hostname=(submission_hostname if (submission_hostname != submission_address) else None), md5sum=hashlib.md5(buf).hexdigest(), sha1sum=hashlib.sha1(buf).hexdigest(), sha256sum=hashlib.sha256(buf).hexdigest(), sha512sum=hashlib.sha512(buf).hexdigest()))
def serialize_requests(g):
    for (common_name, path, buf, req, submitted, server) in g():
        try:
            submission_address = getxattr(path, 'user.request.address').decode('ascii')
        except IOError:
            submission_address = None
        try:
            submission_hostname = getxattr(path, 'user.request.hostname').decode('ascii')
        except IOError:
            submission_hostname = None
        (yield dict(submitted=submitted, common_name=common_name, address=submission_address, hostname=(submission_hostname if (submission_hostname != submission_address) else None), md5sum=hashlib.md5(buf).hexdigest(), sha1sum=hashlib.sha1(buf).hexdigest(), sha256sum=hashlib.sha256(buf).hexdigest(), sha512sum=hashlib.sha512(buf).hexdigest()))