www/curl: Fix TCP_KEEPIDLE unit for DragonFly

DragonFly uses millisecond rather than second as the unit of TCP_KEEPIDLE.
Patch multiples obtained value by 1000 on DragonFly.
Patch will be submitted to curl at SourceForge.
This commit is contained in:
marino 2012-07-20 08:22:04 +00:00
parent 6694bc639a
commit 43760cbc04
3 changed files with 33 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.113 2012/05/29 14:58:05 wiz Exp $
# $NetBSD: Makefile,v 1.114 2012/07/20 08:22:04 marino Exp $
DISTNAME= curl-7.26.0
CATEGORIES= www
PKGREVISION= 1
MASTER_SITES= http://curl.haxx.se/download/ \
ftp://ftp.sunet.se/pub/www/utilities/curl/
EXTRACT_SUFX= .tar.bz2

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.76 2012/05/29 14:58:05 wiz Exp $
$NetBSD: distinfo,v 1.77 2012/07/20 08:22:04 marino Exp $
SHA1 (curl-7.26.0.tar.bz2) = c2e62eaace2407d377bf544d1f808aea6dddf64c
RMD160 (curl-7.26.0.tar.bz2) = 90d66cd2f77bf825ba01056f4f384ff74e7b04eb
Size (curl-7.26.0.tar.bz2) = 2422651 bytes
SHA1 (patch-aa) = 4c5c76b76dc3a43087fdd8edf0de522fde563b3f
SHA1 (patch-lib_connect.c) = 58d9352a2628ffab12a41cdf1b409be198761e91

View file

@ -0,0 +1,29 @@
$NetBSD: patch-lib_connect.c,v 1.1 2012/07/20 08:22:04 marino Exp $
DragonFly uses millisecond as the unit of TCP_KEEP{IDLE} rather than second
Patch to be submitted upstream.
--- lib/connect.c.orig 2012-04-25 15:29:20.000000000 +0000
+++ lib/connect.c
@@ -105,6 +105,10 @@ tcpkeepalive(struct SessionHandle *data,
else {
#ifdef TCP_KEEPIDLE
optval = curlx_sltosi(data->set.tcp_keepidle);
+#ifdef __DragonFly__
+ /* DragonFlyBSD uses millisecond as KEEPIDLE unit */
+ optval *= 1000;
+#endif
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPIDLE on fd %d\n", sockfd);
@@ -112,6 +116,10 @@ tcpkeepalive(struct SessionHandle *data,
#endif
#ifdef TCP_KEEPINTVL
optval = curlx_sltosi(data->set.tcp_keepintvl);
+#ifdef __DragonFly__
+ /* DragonFlyBSD uses millisecond as KEEPINTVL unit */
+ optval *= 1000;
+#endif
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
(void *)&optval, sizeof(optval)) < 0) {
infof(data, "Failed to set TCP_KEEPINTVL on fd %d\n", sockfd);