Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
fix fetch example in smtpd-tables(7)
To:
tech@openbsd.org
Date:
Wed, 22 May 2024 10:25:53 +0200

Download raw body.

Thread
spotted thanks to the irc channel; I got confused by how fetch wraps
around the table, so it won't ever return not-found (unless the table is
empty.)

while here improve the documentation for fetch too so it is less
confusing.

ok?

diff /home/op/w/smtpd
commit - a6d2e78120b97e93aa33655986c3c72fce920250
path + /home/op/w/smtpd
blob - a7f1dc436f40bdc51505843f0992499ae5acadef
file + smtpd-tables.7
--- smtpd-tables.7
+++ smtpd-tables.7
@@ -167,7 +167,7 @@ if not found, or
 .Sq error
 upon an error.
 .It Cm fetch Ar service id
-Fetch the next item from the table.
+Fetch the next item from the table, eventually wrapping around.
 It is only supported for the
 .Ic source
 and
@@ -177,7 +177,7 @@ The result is
 .Sq found
 and the value if found,
 .Sq not-found
-if not found, or
+if the table is empty, or
 .Sq error
 upon an error.
 .El
@@ -255,14 +255,14 @@ A series of
 .Cm fetch
 requests for the
 .Cm source
-service:
+service that wraps around:
 .Bd -literal -offset indent
 table|0.1|1713795116.227321|devs|fetch|source|189bd3ee
 lookup-result|189bd3ee|found|192.168.1.7
 table|0.1|1713795120.162438|devs|fetch|source|9e4c56d4
 lookup-result|9e4c56d4|found|10.0.0.8
 table|0.1|1713795122.930928|devs|fetch|source|f2c8b906
-lookup-result|f2c8b906|not-found
+lookup-result|f2c8b906|found|192.168.1.7
 .Ed
 .Sh SEE ALSO
 .Xr smtpd 8