Skip to content

Commit

Permalink
benchmarks/postal: update to 0.76
Browse files Browse the repository at this point in the history
Major changes:
    * Fix buffer underrun
    * Add -b option to bind to an address to bhm
    * Improve build

Port changes:
    * Update MASTER_SITE and WWW
  • Loading branch information
rosorio committed Sep 15, 2023
1 parent 7bcf779 commit 2cf1aff
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 141 deletions.
9 changes: 4 additions & 5 deletions benchmarks/postal/Makefile
@@ -1,12 +1,11 @@
PORTNAME= postal
PORTVERSION= 0.73
PORTREVISION= 3
PORTVERSION= 0.76
CATEGORIES= benchmarks mail
MASTER_SITES= http://www.coker.com.au/postal/
MASTER_SITES= https://www.coker.com.au/postal/

MAINTAINER= ports@FreeBSD.org
COMMENT= Benchmark SMTP/POP servers
WWW= https://www.coker.com.au/postal/
WWW= https://doc.coker.com.au/projects/postal/

LICENSE= GPLv3

Expand All @@ -22,9 +21,9 @@ PLIST_FILES= bin/postal-list \
sbin/postal \
sbin/rabid

OPTIONS_DEFAULT= OPENSSL
OPTIONS_RADIO= TLS
OPTIONS_RADIO_TLS= GNUTLS OPENSSL
OPTIONS_DEFAULT= OPENSSL

GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls
GNUTLS_USES= pkgconfig
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/postal/distinfo
@@ -1,2 +1,3 @@
SHA256 (postal-0.73.tgz) = 25cc208f5a86d393707164d33a8dfb6ca5b9f586d0d401d549fc15179b766030
SIZE (postal-0.73.tgz) = 106171
TIMESTAMP = 1694465477
SHA256 (postal-0.76.tgz) = 0cc13df48d7e3355289088fbe9ce01fb80ba16fca309d54918c36223b84bf0df
SIZE (postal-0.76.tgz) = 100260
47 changes: 6 additions & 41 deletions benchmarks/postal/files/patch-bhm.cpp
@@ -1,41 +1,6 @@
--- bhm.cpp.orig 2012-01-14 12:09:31 UTC
--- bhm.cpp.orig 2016-06-30 09:04:24 UTC
+++ bhm.cpp
@@ -3,27 +3,25 @@
#endif

#include "bhmusers.h"
-#include <errno.h>
-#include <ctype.h>
+#include <cerrno>
+#include <cctype>
#include <unistd.h>
#include <sys/wait.h>
-#include <signal.h>
-#include <stdio.h>
+#include <csignal>
+#include <cstdio>
+#include <cstdlib>
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#ifndef __FreeBSD__
#include <netinet/ip.h>
+#endif

#include "postal.h"
#include "logit.h"
#include "results.h"
#include "basictcp.h"
-#ifdef USE_GNUTLS
-#include <errno.h>
-#include <gcrypt.h>
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-#endif

int processes = 0;
int *thread_status;
@@ -47,7 +45,7 @@ void usage(CPCCHAR msg = NULL)
@@ -50,7 +50,7 @@

int maxMsgSize = 10240;
results res;
Expand All @@ -44,7 +9,7 @@

int exitCount = 0;

@@ -261,7 +259,7 @@ int readCommand(base_tcp &t, char *buf, int bufSize, b
@@ -264,7 +264,7 @@

void do_work(thread_data *td)
{
Expand All @@ -53,7 +18,7 @@
#ifdef USE_SSL
, td->ssl
#endif
@@ -408,7 +406,7 @@ int main(int argc, char **argv)
@@ -414,7 +414,7 @@
#endif
"\n");

Expand All @@ -62,10 +27,10 @@
Logit *debug = NULL;

if(debugName)
@@ -419,7 +417,7 @@ int main(int argc, char **argv)
@@ -425,7 +425,7 @@
in.sin_family = AF_INET;
in.sin_port = htons(port);
in.sin_addr.s_addr = INADDR_ANY;
memcpy(&in.sin_addr, &sin_addr, sizeof(sin_addr));
- if(listen_fd == -1 || bind(listen_fd, (sockaddr *)&in, sizeof(in))
+ if(listen_fd == -1 || ::bind(listen_fd, (sockaddr *)&in, sizeof(in))
|| listen(listen_fd, 10))
Expand Down
36 changes: 6 additions & 30 deletions benchmarks/postal/files/patch-bhmusers.h
@@ -1,44 +1,20 @@
--- bhmusers.h.orig 2006-09-28 15:20:28 UTC
--- bhmusers.h.orig 2016-06-30 08:57:25 UTC
+++ bhmusers.h
@@ -6,12 +6,16 @@ using namespace std;
@@ -6,7 +6,7 @@
#include <string>
#include "conf.h"

+#if defined(_LIBCPP_VERSION)
-#include <tr1/unordered_map>
+#include <unordered_map>
+#else
#ifdef HAVE_EXT_HASH_MAP
using namespace __gnu_cxx;
#include <ext/hash_map>
#else
#include <hash_map.h>
#endif
+#endif

#include "postal.h"

@@ -23,7 +27,12 @@ typedef struct
@@ -18,7 +18,7 @@
int sync_time;
} BHM_DATA;

+
+#if defined(_LIBCPP_VERSION)
+namespace std
+#else
namespace __gnu_cxx
+#endif
{
template<> struct hash< std::string >
{
@@ -34,7 +43,11 @@ namespace __gnu_cxx
};
}

+#if defined(_LIBCPP_VERSION)
+typedef std::unordered_map<string, BHM_DATA , hash<string> > NAME_MAP;
+#else
typedef hash_map<string, BHM_DATA , hash<string> > NAME_MAP;
+#endif
-typedef std::tr1::unordered_map<string, BHM_DATA, hash<string> > NAME_MAP;
+typedef std::unordered_map<string, BHM_DATA, hash<string> > NAME_MAP;

class BHMUsers
{
21 changes: 0 additions & 21 deletions benchmarks/postal/files/patch-postal.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions benchmarks/postal/files/patch-rabid.cpp

This file was deleted.

26 changes: 6 additions & 20 deletions benchmarks/postal/files/patch-smtp.h
@@ -1,34 +1,20 @@
--- smtp.h.orig 2012-01-14 12:36:56 UTC
--- smtp.h.orig 2016-06-30 08:51:27 UTC
+++ smtp.h
@@ -4,14 +4,18 @@
using namespace std;
#include <string>
@@ -6,7 +6,7 @@
#include <cstring>
-#include <time.h>
+#include <ctime>
#include <time.h>
#include "conf.h"
+#if defined(_LIBCPP_VERSION)
-#include <tr1/unordered_map>
+#include <unordered_map>
+#else
#ifdef HAVE_EXT_HASH_MAP
using namespace __gnu_cxx;
#include <ext/hash_map>
#else
#include <hash_map.h>
#endif
+#endif
#include "tcp.h"
#include "mutex.h"

@@ -30,7 +34,11 @@ struct eqlng
@@ -25,7 +25,7 @@
}
};

+#if defined(_LIBCPP_VERSION)
-typedef std::tr1::unordered_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
+typedef std::unordered_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
+#else
typedef hash_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
+#endif

class smtpData
{

0 comments on commit 2cf1aff

Please sign in to comment.