Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc301a0a

Browse files
committed
Work around OAuth/EVFILT_TIMER quirk on NetBSD.
NetBSD's EVFILT_TIMER doesn't like zero timeouts, as introduced bycommitb3f0be7. Steal the workaround from the same problem on Linuxfrom a few lines up: round zero up to one. Do this only for NetBSD, asthe other systems with the kevent() API accept zero and shouldn't haveto insert a small bogus wait.Future improvement ideas: * when NetBSD < 10 falls out of support, we could try NODE_ABSTIME for the "fire now" meaning if timeout == 0 * when libcurl tells us to start a 0ms timer and call it back, we could figure out how to handle that more directly without involving the kernel (the current architecture doesn't make that straightforward)Failures with EINVAL errors could be seen on the new optional NetBSD CItask that we're trying to keep green as a candidate for inclusion asdefault-enabled CI task. The NetBSD build farm animals aren't testingOAuth yet, so no breakage there.Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>Discussion:https://postgr.es/m/CA%2BhUKGJ%2BWyJ26QGvO_nkgvbxgw%2B03U4EQ4Hxw%2BQBft6Np%2BXW7w%40mail.gmail.com
1 parent8a1012b commitc301a0a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/interfaces/libpq/fe-auth-oauth-curl.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,16 @@ set_timer(struct async_ctx *actx, long timeout)
13631363
#ifdefHAVE_SYS_EVENT_H
13641364
structkeventev;
13651365

1366+
#ifdef__NetBSD__
1367+
1368+
/*
1369+
* Work around NetBSD's rejection of zero timeouts (EINVAL), a bit like
1370+
* timerfd above.
1371+
*/
1372+
if (timeout==0)
1373+
timeout=1;
1374+
#endif
1375+
13661376
/* Enable/disable the timer itself. */
13671377
EV_SET(&ev,1,EVFILT_TIMER,timeout<0 ?EV_DELETE : (EV_ADD |EV_ONESHOT),
13681378
0,timeout,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp