summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-04-14 23:29:57 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-04-14 23:29:57 +0000
commit8ce9c871232e464c74bb63f6ae72731df41bd3cd (patch)
tree8383492560e6a36c8e500f67cbc5a61f70ca1927 /usr.sbin
parent42141c14a76c8180e90413d4125b4c7f6c4f4da9 (diff)
bye bye queue_hash() you can now rest in peace.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/queue_fsqueue.c8
-rw-r--r--usr.sbin/smtpd/queue_shared.c13
-rw-r--r--usr.sbin/smtpd/runner.c5
3 files changed, 7 insertions, 19 deletions
diff --git a/usr.sbin/smtpd/queue_fsqueue.c b/usr.sbin/smtpd/queue_fsqueue.c
index 947f0cce7c8..3bd722cd5d5 100644
--- a/usr.sbin/smtpd/queue_fsqueue.c
+++ b/usr.sbin/smtpd/queue_fsqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_fsqueue.c,v 1.6 2011/04/14 23:26:16 gilles Exp $ */
+/* $OpenBSD: queue_fsqueue.c,v 1.7 2011/04/14 23:29:56 gilles Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -39,7 +39,7 @@
#include "log.h"
static char *fsqueue_getpath(enum queue_kind);
-static u_int16_t fsqueue_hash(char *);
+/*static*/ u_int16_t fsqueue_hash(char *);
static int fsqueue_envelope_load(struct smtpd *, enum queue_kind, struct message *);
static int fsqueue_envelope_update(struct smtpd *, enum queue_kind, struct message *);
@@ -86,7 +86,7 @@ fsqueue_getpath(enum queue_kind kind)
return NULL;
}
-static u_int16_t
+/*static*/ u_int16_t
fsqueue_hash(char *msgid)
{
u_int16_t h;
@@ -319,7 +319,7 @@ fsqueue_message_create(struct smtpd *env, enum queue_kind qkind, char *msgid)
if (qkind == Q_BOUNCE) {
if (! bsnprintf(msgpath, sizeof(msgpath), "%s/%d/%s/message",
fsqueue_getpath(Q_QUEUE),
- queue_hash(msgid_save), msgid_save))
+ fsqueue_hash(msgid_save), msgid_save))
return 0;
if (! bsnprintf(lnkpath, sizeof(lnkpath), "%s/%s/message",
diff --git a/usr.sbin/smtpd/queue_shared.c b/usr.sbin/smtpd/queue_shared.c
index 654b06e0b6c..ff6dbc4879f 100644
--- a/usr.sbin/smtpd/queue_shared.c
+++ b/usr.sbin/smtpd/queue_shared.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_shared.c,v 1.42 2011/04/14 23:26:16 gilles Exp $ */
+/* $OpenBSD: queue_shared.c,v 1.43 2011/04/14 23:29:56 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -112,17 +112,6 @@ queue_message_update(struct smtpd *env, struct message *messagep)
queue_envelope_delete(env, Q_QUEUE, messagep);
}
-u_int16_t
-queue_hash(char *msgid)
-{
- u_int16_t h;
-
- for (h = 5381; *msgid; msgid++)
- h = ((h << 5) + h) + *msgid;
-
- return (h % DIRHASH_BUCKETS);
-}
-
struct qwalk *
qwalk_new(char *path)
{
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c
index b5f873c1f7a..63a36ac3b26 100644
--- a/usr.sbin/smtpd/runner.c
+++ b/usr.sbin/smtpd/runner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: runner.c,v 1.99 2011/04/14 22:36:09 gilles Exp $ */
+/* $OpenBSD: runner.c,v 1.100 2011/04/14 23:29:56 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -494,10 +494,9 @@ runner_force_message_to_ramqueue(struct ramqueue *rqueue, char *mid)
time_t curtm;
if (! bsnprintf(path, MAXPATHLEN, "%s/%d/%s/envelopes",
- PATH_QUEUE, queue_hash(mid), mid))
+ PATH_QUEUE, fsqueue_hash(mid), mid))
return 0;
-
dirp = opendir(path);
if (dirp == NULL)
return 0;