ports/109670: update of ports/ftp/curl to the version 7.16.1

Eygene Ryabinkin rea-fbsd at codelabs.ru
Fri Mar 2 11:04:55 UTC 2007


Spotted an error in a distinfo's patch: wrong file name in a SIZE
clause. Corrected patch version is below.

diff -urN curl.orig/Makefile curl/Makefile
--- curl.orig/Makefile	Tue Feb 27 13:31:52 2007
+++ curl/Makefile	Tue Feb 27 13:32:40 2007
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	curl
-PORTVERSION=	7.16.0
-PORTREVISION=	1
+PORTVERSION=	7.16.1
 CATEGORIES=	ftp ipv6 www
 MASTER_SITES=	http://curl.haxx.se/download/ \
 		${MASTER_SITE_SOURCEFORGE} \
@@ -57,7 +56,8 @@
 		KERBEROS4 "Kerberos 4 authentication" off \
 		LIBIDN "Internationalized Domain Names via libidn" off \
 		NTLM "NTLM authentication" off \
-		OPENSSL "OpenSSL support" on
+		OPENSSL "OpenSSL support" on \
+		DEBUG "Debugging code" off
 
 .include <bsd.port.pre.mk>
 
@@ -127,6 +127,10 @@
 CONFIGURE_ARGS+=	--enable-ntlm
 .else
 CONFIGURE_ARGS+=	--disable-ntlm
+.endif
+
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+=	--enable-debug
 .endif
 
 post-patch:
diff -urN curl.orig/distinfo curl/distinfo
--- curl.orig/distinfo	Tue Feb 27 13:31:52 2007
+++ curl/distinfo	Tue Feb 27 13:34:07 2007
@@ -1,3 +1,3 @@
-MD5 (curl-7.16.0.tar.bz2) = 5819f56e93d04cde2992fe88b54cbfad
-SHA256 (curl-7.16.0.tar.bz2) = fc8dcda5a933c370c15c832bf1e7316a0690f473fdd6000454d233edaa33bc23
-SIZE (curl-7.16.0.tar.bz2) = 1566391
+MD5 (curl-7.16.1.tar.bz2) = acdab0b0467c55e10ed02d2afed80575
+SHA256 (curl-7.16.1.tar.bz2) = 257b204acf1d80314694b4cf63cccbc7c70bccee75cb3d9924bbb061ec6bccef
+SIZE (curl-7.16.1.tar.bz2) = 1592074
diff -urN curl.orig/files/patch-configure curl/files/patch-configure
--- curl.orig/files/patch-configure	Tue Feb 27 13:31:52 2007
+++ curl/files/patch-configure	Tue Feb 27 13:36:35 2007
@@ -11,12 +11,3 @@
      ;;
    esac
  
-@@ -35638,7 +35640,7 @@
- main ()
- {
- #ifndef basename
--  char *p = (char *) basename;
-+  char *(*p)(const char *) = basename;
-   return !p;
- #endif
- 
--- lib/multi.c.orig	Sat Jan 27 21:22:02 2007
+++ lib/multi.c	Wed Feb 28 17:40:26 2007
@@ -1986,3 +1986,51 @@
   }
 }
 #endif
+
+/*
+ * Walks through all easy handles and returns the number of
+ * easy connections in the multi stack that are using the
+ * given 'connection'.
+ */
+int Curl_multi_connection_used(struct Curl_multi *multi,
+                               struct connectdata *connection)
+{
+  int count = 0;
+  struct Curl_one_easy *easy;
+
+  easy = multi->easy.next;
+  while (easy) {
+    if (easy->easy_conn == connection) {
+      fprintf(stderr, "Used in easy = 0x%x\n", easy);
+      count++;
+    }
+    easy=easy->next;
+  }
+
+  fprintf(stderr, "Connection 0x%x, multi 0x%x: %d references.\n",
+    connection, multi, count);
+
+  return count;
+}
+
+/*
+ * Walks through all easy handles and sets the easy_conn fields
+ * that are equal to 'connection' to NULL. Also sets easy's state
+ * to CURLM_STATE_COMPLETED.
+ */
+void Curl_multi_dissociate_connection(struct Curl_multi *multi,
+                                      struct connectdata *connection)
+{
+  struct Curl_one_easy *easy;
+
+  easy = multi->easy.next;
+  while (easy) {
+    if (easy->easy_conn == connection) {
+      easy->easy_conn = NULL;
+      easy->state = CURLM_STATE_COMPLETED;
+    }
+    easy=easy->next;
+  }
+
+  return;
+}
--- lib/url.c.orig	Sun Jan 28 22:45:22 2007
+++ lib/url.c	Wed Feb 28 17:53:14 2007
@@ -553,6 +553,10 @@
     data->set.httpauth = CURLAUTH_BASIC;  /* defaults to basic */
     data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */
 
+#if defined(__FreeBSD_version)
+    data->set.no_signal = TRUE; /* different handling of signals and threads */
+#endif /* __FreeBSD_version */
+
     /* This no longer creates a connection cache here. It is instead made on
        the first call to curl_easy_perform() or when the handle is added to a
        multi stack. */
@@ -1835,6 +1839,18 @@
     signalPipeClose(conn->recv_pipe);
   }
 
+  /* This connection can be used by some other easy thingy. If
+   * not, then we should clean the easy's easy_conn field to
+   * avoid storing the freed pointer. */
+  if (data->magic == CURLEASY_MAGIC_NUMBER) {
+    if (Curl_multi_connection_used(data->multi, conn) > 1000) {
+      return CURLE_OK;
+    } else {
+      Curl_multi_dissociate_connection(data->multi, conn);
+    }
+  }
+
+  fprintf(stderr, "Freeing connection 0x%x\n", conn);
   conn_free(conn);
 
   return CURLE_OK;
--- lib/multiif.h.orig	Mon Oct 23 06:47:06 2006
+++ lib/multiif.h	Wed Feb 28 16:53:47 2007
@@ -32,6 +32,12 @@
 
 bool Curl_multi_canPipeline(struct Curl_multi* multi);
 
+int Curl_multi_connection_used(struct Curl_multi *multi,
+                               struct connectdata *connection);
+
+void Curl_multi_dissociate_connection(struct Curl_multi *multi,
+                                      struct connectdata *connection);
+
 /* the write bits start at bit 16 for the *getsock() bitmap */
 #define GETSOCK_WRITEBITSTART 16



More information about the freebsd-ports-bugs mailing list