benchmarks/postal: update to 0.76

Major changes:
    * Fix buffer underrun
    * Add -b option to bind to an address to bhm
    * Improve build

Port changes:
    * Update MASTER_SITE and WWW
This commit is contained in:
Rodrigo Osorio 2023-09-14 16:04:11 +02:00
parent 7bcf779c11
commit 2cf1aff496
7 changed files with 25 additions and 141 deletions

View file

@ -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
@ -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

View file

@ -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

View file

@ -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;
@ -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)
{
@ -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");
@ -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))

View file

@ -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
{

View file

@ -1,21 +0,0 @@
--- postal.cpp.orig 2012-01-14 12:08:12 UTC
+++ postal.cpp
@@ -6,15 +6,11 @@
#include "smtp.h"
#include <unistd.h>
#include <sys/wait.h>
-#include <signal.h>
-#include <stdio.h>
+#include <csignal>
+#include <cstdio>
+#include <cstdlib>
#include "postal.h"
#include "logit.h"
-#ifdef USE_GNUTLS
-#include <errno.h>
-#include <gcrypt.h>
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-#endif
void usage()
{

View file

@ -1,22 +0,0 @@
--- rabid.cpp.orig 2012-01-14 12:08:49 UTC
+++ rabid.cpp
@@ -7,15 +7,14 @@
#include <cstdlib>
#include <unistd.h>
#include <sys/wait.h>
-#include <signal.h>
-#include <stdio.h>
+#include <csignal>
+#include <cstdio>
+#include <cstring>
#include <strings.h>
#include "postal.h"
#include "logit.h"
#ifdef USE_GNUTLS
-#include <errno.h>
-#include <gcrypt.h>
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
+#include <cerrno>
#endif
void usage()

View file

@ -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
{