mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 11:56:28 -04:00
games/vcmi: the port had been updated to version 1.1.1
Rather than hardcoding socket buffer size to 4MB, set it based on the ``kern.ipc.maxsockbuf'' sysctl value*. Reported by: portscout *) https://bugs.vcmi.eu/view.php?id=3027
This commit is contained in:
parent
470fc7f804
commit
0f57a0feb8
3 changed files with 31 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
PORTNAME= vcmi
|
||||
PORTVERSION= 1.1.0
|
||||
PORTVERSION= 1.1.1
|
||||
CATEGORIES= games
|
||||
|
||||
MAINTAINER= danfe@FreeBSD.org
|
||||
|
@ -36,7 +36,7 @@ QT_USE= QT=buildtools:build,qmake:build,core,gui,network,widgets
|
|||
QT_CMAKE_OFF= -DENABLE_LAUNCHER:BOOL=OFF -DENABLE_EDITOR:BOOL=OFF
|
||||
|
||||
post-configure:
|
||||
${SED} -e 's,@GIT_SHA1@,5278271,' ${WRKSRC}/Version.cpp.in \
|
||||
${SED} -e 's,@GIT_SHA1@,b429f0b,' ${WRKSRC}/Version.cpp.in \
|
||||
> ${BUILD_WRKSRC}/Version.cpp
|
||||
|
||||
post-install-DOCS-on:
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
TIMESTAMP = 1671792720
|
||||
SHA256 (vcmi-vcmi-1.1.0_GH0.tar.gz) = 39db3ac7a2d1e386be1982957c0746e4e47f0d6a57268a57e65df9c95c967474
|
||||
SIZE (vcmi-vcmi-1.1.0_GH0.tar.gz) = 6412813
|
||||
TIMESTAMP = 1675416308
|
||||
SHA256 (vcmi-vcmi-1.1.1_GH0.tar.gz) = 41cf343e45a3c1f4ddf95e97697c25e68e40b93f681c0b9d631b3c9d1608a49b
|
||||
SIZE (vcmi-vcmi-1.1.1_GH0.tar.gz) = 6412309
|
||||
|
|
26
games/vcmi/files/patch-lib_serializer_Connection.cpp
Normal file
26
games/vcmi/files/patch-lib_serializer_Connection.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
--- lib/serializer/Connection.cpp.orig 2023-02-03 09:25:08 UTC
|
||||
+++ lib/serializer/Connection.cpp
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../CGameState.h"
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
+#include <sys/sysctl.h>
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@@ -46,8 +47,13 @@ void CConnection::init()
|
||||
socket->set_option(boost::asio::ip::tcp::no_delay(true));
|
||||
try
|
||||
{
|
||||
- socket->set_option(boost::asio::socket_base::send_buffer_size(4194304));
|
||||
- socket->set_option(boost::asio::socket_base::receive_buffer_size(4194304));
|
||||
+ unsigned long sb_max, sb_max_adj;
|
||||
+ size_t len = sizeof(sb_max);
|
||||
+ (void)sysctlbyname("kern.ipc.maxsockbuf", &sb_max, &len, NULL, 0);
|
||||
+ sb_max_adj = sb_max * MCLBYTES / (MSIZE + MCLBYTES);
|
||||
+
|
||||
+ socket->set_option(boost::asio::socket_base::send_buffer_size(sb_max_adj));
|
||||
+ socket->set_option(boost::asio::socket_base::receive_buffer_size(sb_max_adj));
|
||||
}
|
||||
catch (const boost::system::system_error & e)
|
||||
{
|
Loading…
Add table
Reference in a new issue