https://bugzilla.mindrot.org/show_bug.cgi?id=3655

Damien Miller <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #6 from Damien Miller <[email protected]> ---
Thanks for the patch - it looks good, except for this bit

> +     for (i = 0; i < ssh->chanctxt->channels_alloc; i++) {
> +         c = ssh->chanctxt->channels[i];
> +         if (c == NULL || c->ctype == NULL || c->lastused == 0 ||
> +             strcmp(c->ctype, "x11-connection"))
> +             continue;
> +         if (monotime() - c->lastused < 1)
> +             return 1;
> +     }

which will call monotime() a bunch.

IMO it would be better to do something like this:

time_t lastused = 0;
for (i = 0; i < ssh->chanctxt->channels_alloc; i++) {
        c = ssh->chanctxt->channels[i];
        if (c == NULL || c->ctype == NULL || c->lastused == 0 ||
            strcmp(c->ctype, "x11-connection"))
                continue;
        lastused = c->lastused;
}
return (lastused != 0 && monotime() > lastused + 1);

-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to