ports/65403: [lang/php4] Fix php4 build with curl 7.11.1
Sunpoet Po-Chuan Hsieh
sunpoet at sunpoet.net
Sat Apr 10 18:30:20 UTC 2004
>Number: 65403
>Category: ports
>Synopsis: [lang/php4] Fix php4 build with curl 7.11.1
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 10 11:30:19 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator: Sunpoet Po-Chuan Hsieh
>Release: FreeBSD 5.2-CURRENT i386
>Organization:
SUNPOET.net
>Environment:
System: FreeBSD IRIS.sunpoet.net 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue Mar 23 18:25:35 CST 2004 sunpoet at IRIS.sunpoet.net:/usr/src/sys/i386/compile/sunpoet i386
>Description:
After upgrading curl from 7.10.0 to 7.11.1, building php4 failed for two changes:
1. HttpPost -> curl_httppost
2. CURLOPT_PASSWDFUNCTION is defined as 0 (same as CURLOPT_MUTE)
Compilation passed after patching ext/curl/curl.c.
Note: this patch works for curl 7.11.1 only.
>How-To-Repeat:
% pkg_info -Ix curl
curl-7.11.1 Non-interactive tool to get files from FTP, GOPHER, HTTP(S)
% cd /usr/ports/lang/php4
% make
===> Building for php4-4.3.5_7
/bin/sh /usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/curl/ -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/ -DPHP_ATOM_INC -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/include -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/main -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5 -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/Zend -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/freetype2 -I/usr/local/include/c-client -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/mbstring/mbregex -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/mbstring/libmbfl -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/mbstring/libmbfl/mbfl -I/usr/local/include/mysql -I/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/TSRM -O2 -pipe -s -march=pentium4 -prefer-pic -c /usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c -o ext
/curl/curl.lo
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c: In function `curl_free_post':
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:568: warning: passing arg 1 of `curl_formfree' from incompatible pointer type
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c: In function `alloc_curl_handle':
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:608: error: invalid application of `sizeof' to an incomplete type
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c: In function `zif_curl_setopt':
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:845: error: duplicate case value
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:700: error: previously used here
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:890: warning: passing arg 1 of `curl_formadd' from incompatible pointer type
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:890: warning: passing arg 2 of `curl_formadd' from incompatible pointer type
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:898: warning: passing arg 1 of `curl_formadd' from incompatible pointer type
/usr/ports/works/usr/ports/lang/php4/work/php-4.3.5/ext/curl/curl.c:898: warning: passing arg 2 of `curl_formadd' from incompatible pointer type
*** Error code 1
Stop in /usr/ports/works/usr/ports/lang/php4/work/php-4.3.5.
*** Error code 1
Stop in /usr/ports/lang/php4.
*** Error code 1
Stop in /usr/ports/lang/php4.
>Fix:
% diff -u ext/curl/curl.c.orig ext/curl/curl.c
--- ext/curl/curl.c.orig Sat Mar 13 01:43:17 2004
+++ ext/curl/curl.c Sun Apr 11 01:51:38 2004
@@ -565,7 +565,7 @@
*/
static void curl_free_post(void **post)
{
- curl_formfree((struct HttpPost *) *post);
+ curl_formfree((struct curl_httppost *) *post);
}
/* }}} */
@@ -605,7 +605,7 @@
(void(*)(void *)) curl_free_string, 0);
zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist),
(void(*)(void *)) curl_free_slist, 0);
- zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost),
+ zend_llist_init(&(*ch)->to_free.post, sizeof(struct curl_httppost),
(void(*)(void *)) curl_free_post, 0);
}
/* }}} */
@@ -842,6 +842,7 @@
ch->handlers->write_header->func = *zvalue;
ch->handlers->write_header->method = PHP_CURL_USER;
break;
+/*
case CURLOPT_PASSWDFUNCTION:
if (ch->handlers->passwd) {
zval_ptr_dtor(&ch->handlers->passwd);
@@ -851,12 +852,13 @@
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd);
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch);
break;
+*/
case CURLOPT_POSTFIELDS:
if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) {
zval **current;
HashTable *postfields;
- struct HttpPost *first = NULL;
- struct HttpPost *last = NULL;
+ struct curl_httppost *first = NULL;
+ struct curl_httppost *last = NULL;
char *postval;
char *string_key = NULL;
ulong num_key;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list