[PHP-CVS] cvs: php4 /main php_ini.c
zeevMon Sep 23 08:10:07 2002 EDT Modified files: /php4/main php_ini.c Log: Compat fix Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.101 php4/main/php_ini.c:1.102 --- php4/main/php_ini.c:1.101 Thu Sep 19 17:57:24 2002 +++ php4/main/php_ini.c Mon Sep 23 08:10:07 2002 -16,7 +16,7 +--+ */ -/* $Id: php_ini.c,v 1.101 2002/09/19 21:57:24 cmv Exp $ */ +/* $Id: php_ini.c,v 1.102 2002/09/23 12:10:07 zeev Exp $ */ /* Check CWD for php.ini */ #define INI_CHECK_CWD -134,7 +134,7 } php_info_print_table_start(); php_info_print_table_header(3, Directive, Local Value, Master Value); - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (long) module_number TSRMLS_CC); + zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) +php_ini_displayer, (void *) (long) module_number TSRMLS_CC); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard/tests/file userstreams.phpt /main memory_streams.c php_streams.h streams.c user_streams.c
wez Mon Sep 23 09:22:10 2002 EDT Modified files: /php4/main memory_streams.c php_streams.h streams.c user_streams.c /php4/ext/standard/tests/file userstreams.phpt Log: Revise buffer/seek code a little. Tidy up user streams even more. Make test case quite aggressive. Index: php4/main/memory_streams.c diff -u php4/main/memory_streams.c:1.17 php4/main/memory_streams.c:1.18 --- php4/main/memory_streams.c:1.17 Sun Sep 22 21:47:03 2002 +++ php4/main/memory_streams.c Mon Sep 23 09:22:10 2002 -216,6 +216,7 PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC) { php_stream_memory_data *self; + php_stream *stream; self = emalloc(sizeof(*self)); assert(self != NULL); -224,7 +225,10 self-fsize = 0; self-smax = -1; self-mode = mode; - return php_stream_alloc(php_stream_memory_ops, self, 0, rwb); + + stream = php_stream_alloc(php_stream_memory_ops, self, 0, rwb); + stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; + return stream; } /* }}} */ -435,8 +439,9 self-smax = max_memory_usage; self-mode = mode; stream = php_stream_alloc(php_stream_temp_ops, self, 0, rwb); + stream-flags |= PHP_STREAM_FLAG_NO_BUFFER; self-innerstream = php_stream_memory_create(mode); -/* php_stream_temp_write(stream, NULL, 0 TSRMLS_CC); */ + return stream; } /* }}} */ Index: php4/main/php_streams.h diff -u php4/main/php_streams.h:1.44 php4/main/php_streams.h:1.45 --- php4/main/php_streams.h:1.44Sun Sep 22 21:47:04 2002 +++ php4/main/php_streams.h Mon Sep 23 09:22:10 2002 -377,6 +377,10 #define PHP_STREAM_BUFFER_LINE 1 /* line buffered */ #define PHP_STREAM_BUFFER_FULL 2 /* fully buffered */ +#define PHP_STREAM_OPTION_RETURN_OK 0 /* option set OK */ +#define PHP_STREAM_OPTION_RETURN_ERR -1 /* problem setting option */ +#define PHP_STREAM_OPTION_RETURN_NOTIMPL -2 /* underlying stream does not +implement; streams can handle it instead */ + /* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, copy until eof(src). * Uses mmap if the src is a plain file and at offset 0 */ #define PHP_STREAM_COPY_ALL-1 Index: php4/main/streams.c diff -u php4/main/streams.c:1.75 php4/main/streams.c:1.76 --- php4/main/streams.c:1.75Sun Sep 22 21:47:04 2002 +++ php4/main/streams.c Mon Sep 23 09:22:10 2002 -20,7 +20,7 +--+ */ -/* $Id: streams.c,v 1.75 2002/09/23 01:47:04 wez Exp $ */ +/* $Id: streams.c,v 1.76 2002/09/23 13:22:10 wez Exp $ */ #define _GNU_SOURCE #include php.h -357,8 +357,36 PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC) { + size_t avail, toread, didread = 0; + + /* take from the read buffer first. +* It is possible that a buffered stream was switched to non-buffered, so we +* drain the remainder of the buffer before using the raw read mode for +* the excess */ + avail = stream-writepos - stream-readpos; + if (avail) { + toread = avail; + if (toread size) + toread = size; + + memcpy(buf, stream-readbuf + stream-readpos, toread); + stream-readpos += toread; + size -= toread; + buf += toread; + didread += size; + } + + if (size == 0) + return didread; + if (stream-flags PHP_STREAM_FLAG_NO_BUFFER || stream-chunk_size == 1) { - return stream-ops-read(stream, buf, size TSRMLS_CC); + if (stream-filterhead) { + didread += stream-filterhead-fops-read(stream, +stream-filterhead, + buf, size + TSRMLS_CC); + } else { + didread += stream-ops-read(stream, buf, size TSRMLS_CC); + } } else { php_stream_fill_read_buffer(stream, size TSRMLS_CC); -367,9 +395,10 memcpy(buf, stream-readbuf + stream-readpos, size); stream-readpos += size; - stream-position += size; - return size; + didread += size; } + stream-position += size; + return didread; } PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) -550,7 +579,7 PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC) { /* not moving anywhere */ - if (offset == 0 whence == SEEK_CUR) + if ((offset == 0 whence == SEEK_CUR) || (offset == stream-position +whence == SEEK_SET)) return 0; /* handle the case where we are in the buffer */ -576,6 +605,8
[PHP-CVS] cvs: php4 /ext/session session.c
sas Mon Sep 23 10:04:51 2002 EDT Modified files: /php4/ext/session session.c Log: (php_get_session_var) Always return FAILURE if no data source was found. Noticed by: Sebastian Bergmann Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.314 php4/ext/session/session.c:1.315 --- php4/ext/session/session.c:1.314Sat Sep 21 01:46:32 2002 +++ php4/ext/session/session.c Mon Sep 23 10:04:50 2002 -17,7 +17,7 +--+ */ -/* $Id: session.c,v 1.314 2002/09/21 05:46:32 sas Exp $ */ +/* $Id: session.c,v 1.315 2002/09/23 14:04:50 sas Exp $ */ #ifdef HAVE_CONFIG_H #include config.h -287,10 +287,10 if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, (void **) state_var)==SUCCESS) { return SUCCESS; } - } else if (!PG(register_globals)) { - /* register_globals is disabled, but we don't have http_session_vars */ - return FAILURE; - } + } + + /* register_globals is disabled, but we don't have http_session_vars */ + return FAILURE; } #define PS_BIN_NR_OF_BITS 8 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main output.c
zeevMon Sep 23 10:18:43 2002 EDT Modified files: /php4/main output.c Log: Fix bug #19525 Index: php4/main/output.c diff -u php4/main/output.c:1.120 php4/main/output.c:1.121 --- php4/main/output.c:1.120Sun Sep 1 07:33:19 2002 +++ php4/main/output.c Mon Sep 23 10:18:42 2002 -18,7 +18,7 +--+ */ -/* $Id: output.c,v 1.120 2002/09/01 11:33:19 sebastian Exp $ */ +/* $Id: output.c,v 1.121 2002/09/23 14:18:42 zeev Exp $ */ #include php.h #include ext/standard/head.h -120,6 +120,12 uint initial_size, block_size; if (OG(ob_lock)) { + if (SG(headers_sent) !SG(request_info).headers_only) { + OG(php_body_write) = php_ub_body_write_no_header; + } else { + OG(php_body_write) = php_ub_body_write; + } + OG(ob_nesting_level) = 0; php_error_docref(ref.outcontrol TSRMLS_CC, E_ERROR, Cannot use output buffering in output buffering display handlers); return FAILURE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
sebastian Mon Sep 23 10:20:03 2002 EDT Modified files: /php4/ext/standard string.c Log: Fix warning. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.296 php4/ext/standard/string.c:1.297 --- php4/ext/standard/string.c:1.296Sat Sep 21 13:34:06 2002 +++ php4/ext/standard/string.c Mon Sep 23 10:20:02 2002 -18,7 +18,7 +--+ */ -/* $Id: string.c,v 1.296 2002/09/21 17:34:06 iliaa Exp $ */ +/* $Id: string.c,v 1.297 2002/09/23 14:20:02 sebastian Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ -3113,7 +3113,6 { pval ***args = (pval ***) emalloc(sizeof(pval **)*ZEND_NUM_ARGS()); zval **pcategory, **plocale; - zval *locale; int i, cat, n_args=ZEND_NUM_ARGS(); char *loc, *retval; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/ftp ftp.c /main php_streams.h streams.c
wez Mon Sep 23 10:50:22 2002 EDT Modified files: /php4/main php_streams.h streams.c /php4/ext/ftp ftp.c Log: fix some warnings. Index: php4/main/php_streams.h diff -u php4/main/php_streams.h:1.45 php4/main/php_streams.h:1.46 --- php4/main/php_streams.h:1.45Mon Sep 23 09:22:10 2002 +++ php4/main/php_streams.h Mon Sep 23 10:50:20 2002 -255,8 +255,8 off_t position; /* of underlying stream */ unsigned char *readbuf; size_t readbuflen; - size_t readpos; - size_t writepos; + off_t readpos; + off_t writepos; /* how much data to read when filling buffer */ size_t chunk_size; Index: php4/main/streams.c diff -u php4/main/streams.c:1.76 php4/main/streams.c:1.77 --- php4/main/streams.c:1.76Mon Sep 23 09:22:10 2002 +++ php4/main/streams.c Mon Sep 23 10:50:21 2002 -20,7 +20,7 +--+ */ -/* $Id: streams.c,v 1.76 2002/09/23 13:22:10 wez Exp $ */ +/* $Id: streams.c,v 1.77 2002/09/23 14:50:21 wez Exp $ */ #define _GNU_SOURCE #include php.h -512,7 +512,7 eol = memchr(readptr, '\n', avail); } - if (eol (eol + 1 - readptr) = maxlen - 1) { + if (eol ((ptrdiff_t)eol + 1 - (ptrdiff_t)readptr) = maxlen - 1) { justread = eol + 1 - readptr; } else { eol = NULL; Index: php4/ext/ftp/ftp.c diff -u php4/ext/ftp/ftp.c:1.62 php4/ext/ftp/ftp.c:1.63 --- php4/ext/ftp/ftp.c:1.62 Wed Sep 11 06:28:22 2002 +++ php4/ext/ftp/ftp.c Mon Sep 23 10:50:21 2002 -17,7 +17,7 +--+ */ -/* $Id: ftp.c,v 1.62 2002/09/11 10:28:22 hyanantha Exp $ */ +/* $Id: ftp.c,v 1.63 2002/09/23 14:50:21 wez Exp $ */ #include php.h -571,7 +571,7 databuf_t *data = NULL; char*ptr; int lastch; - int rcvd; + size_t rcvd; chararg[11]; TSRMLS_FETCH(); -1443,7 +1443,7 databuf_t *data = NULL; char*ptr; int lastch; - int rcvd; + size_t rcvd; ftptype_t type; TSRMLS_FETCH(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main streams.c
wez Mon Sep 23 11:21:17 2002 EDT Modified files: /php4/main streams.c Log: Hopefully fix the other warnings that my last warning-fixing commit caused. Index: php4/main/streams.c diff -u php4/main/streams.c:1.77 php4/main/streams.c:1.78 --- php4/main/streams.c:1.77Mon Sep 23 10:50:21 2002 +++ php4/main/streams.c Mon Sep 23 11:21:16 2002 -20,7 +20,7 +--+ */ -/* $Id: streams.c,v 1.77 2002/09/23 14:50:21 wez Exp $ */ +/* $Id: streams.c,v 1.78 2002/09/23 15:21:16 wez Exp $ */ #define _GNU_SOURCE #include php.h -33,6 +33,8 #include sys/mman.h #endif +#include stddef.h + #include fcntl.h #ifndef MAP_FAILED -320,7 +322,7 /* allocate/fill the buffer */ /* is there enough data in the buffer ? */ - while (stream-writepos - stream-readpos size) { + while (stream-writepos - stream-readpos (off_t)size) { size_t justread; /* no; so lets fetch more data */ -390,7 +392,7 } else { php_stream_fill_read_buffer(stream, size TSRMLS_CC); - if (size stream-writepos - stream-readpos) + if ((off_t)size stream-writepos - stream-readpos) size = stream-writepos - stream-readpos; memcpy(buf, stream-readbuf + stream-readpos, size); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /sapi/thttpd thttpd_patch
sas Mon Sep 23 11:41:44 2002 EDT Modified files: /php4/sapi/thttpd thttpd_patch Log: Force /nocache/ entities to be delivered completely, even if a broken proxy ignores our anti-cache headers and sends an IMS request. Index: php4/sapi/thttpd/thttpd_patch diff -u php4/sapi/thttpd/thttpd_patch:1.18 php4/sapi/thttpd/thttpd_patch:1.19 --- php4/sapi/thttpd/thttpd_patch:1.18 Sat Sep 21 13:23:15 2002 +++ php4/sapi/thttpd/thttpd_patch Mon Sep 23 11:41:44 2002 -1,6 +1,6 -diff -Nur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in +diff -ur thttpd-2.21b/Makefile.in thttpd-2.21b-cool/Makefile.in --- thttpd-2.21b/Makefile.in Thu Mar 29 20:36:21 2001 -+++ thttpd-2.21b-cool/Makefile.in Sat Sep 7 15:43:49 2002 thttpd-2.21b-cool/Makefile.in Mon Sep 23 17:37:36 2002 -46,13 +46,15 # You shouldn't need to edit anything below here. -38,9 +38,9 tar: name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \ -diff -Nur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h +diff -ur thttpd-2.21b/config.h thttpd-2.21b-cool/config.h --- thttpd-2.21b/config.h Mon Apr 9 23:57:36 2001 -+++ thttpd-2.21b-cool/config.h Sat Sep 7 15:43:49 2002 thttpd-2.21b-cool/config.h Sun Sep 22 22:44:56 2002 -82,6 +82,11 */ #define IDLE_READ_TIMELIMIT 60 -62,9 +62,9 /* CONFIGURE: If this is defined then thttpd will automatically generate ** index pages for directories that don't have an explicit index file. -diff -Nur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c +diff -ur thttpd-2.21b/fdwatch.c thttpd-2.21b-cool/fdwatch.c --- thttpd-2.21b/fdwatch.c Fri Apr 13 07:36:08 2001 -+++ thttpd-2.21b-cool/fdwatch.cSat Sep 21 19:15:38 2002 thttpd-2.21b-cool/fdwatch.cMon Sep 23 17:38:03 2002 -460,7 +460,7 ridx = 0; -85,9 +85,9 default: return 0; } } -diff -Nur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c +diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c --- thttpd-2.21b/libhttpd.cTue Apr 24 00:42:40 2001 -+++ thttpd-2.21b-cool/libhttpd.c Sat Sep 21 18:17:49 2002 thttpd-2.21b-cool/libhttpd.c Mon Sep 23 17:29:24 2002 -85,6 +85,8 #include match.h #include tdate_parse.h -408,7 +408,15 if ( hc-method == METHOD_GET || hc-method == METHOD_POST ) { httpd_clear_ndelay( hc-conn_fd ); - -3561,6 +3616,11 + -3369,6 +3424,7 + int expnlen, indxlen; + char* cp; + char* pi; ++int nocache = 0; + + expnlen = strlen( hc-expnfilename ); + + -3561,6 +3617,11 match( hc-hs-cgi_pattern, hc-expnfilename ) ) return cgi( hc ); -420,22 +428,38 /* It's not CGI. If it's executable or there's pathinfo, someone's ** trying to either serve or run a non-CGI file as CGI. Either case ** is prohibited. - -3611,14 +3671,27 + -3594,6 +3655,8 + hc-end_byte_loc = hc-sb.st_size - 1; + + figure_mime( hc ); ++if ( strncmp(hc-decodedurl, /nocache/, sizeof(/nocache/) - 1 ) == 0 ) ++ nocache = 1; + + if ( hc-method == METHOD_HEAD ) + { + -3601,7 +3664,7 + hc, 200, ok200title, hc-encodings, , hc-type, hc-sb.st_size, + hc-sb.st_mtime ); + } +-else if ( hc-if_modified_since != (time_t) -1 ++else if ( !nocache hc-if_modified_since != (time_t) -1 +hc-if_modified_since = hc-sb.st_mtime ) + { + hc-method = METHOD_HEAD; + -3611,14 +3674,25 } else { - hc-file_address = mmc_map( hc-expnfilename, (hc-sb), nowP ); -+ char *extraheads = ; -+ int nocache = 0; -+ -+ if (strncmp(hc-decodedurl, /nocache/, sizeof(/nocache/)-1) == 0) { -+ extraheads = Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n -+ Cache-Control: no-store, no-cache, must-revalidate, -+ post-check=0, pre-check=0\r\n -+ Pragma: no-cache\r\n; ++ char *extraheads = ; + -+ nocache = 1; -+ } ++ if ( nocache ) ++ { ++ extraheads = Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n ++ Cache-Control: no-store, no-cache, must-revalidate, ++ post-check=0, pre-check=0\r\n ++ Pragma: no-cache\r\n; ++ } + + hc-file_address = mmc_map( hc-expnfilename, (hc-sb), nowP, nocache ); if ( hc-file_address == (char*) 0 ) -450,9 +474,9 hc-sb.st_mtime ); } -diff -Nur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h +diff -ur thttpd-2.21b/libhttpd.h thttpd-2.21b-cool/libhttpd.h --- thttpd-2.21b/libhttpd.hTue Apr 24 00:36:50 2001 -+++ thttpd-2.21b-cool/libhttpd.h Sat Sep 7 15:43:49 2002 thttpd-2.21b-cool/libhttpd.h Sun Sep 22 22:44:56 2002 -69,6 +69,7 char*
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
wez Mon Sep 23 13:27:38 2002 EDT Modified files: /php4/ext/standard basic_functions.c Log: basic_functions.c Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.508 php4/ext/standard/basic_functions.c:1.509 --- php4/ext/standard/basic_functions.c:1.508 Sat Sep 21 10:50:04 2002 +++ php4/ext/standard/basic_functions.c Mon Sep 23 13:27:37 2002 -17,7 +17,7 +--+ */ -/* $Id: basic_functions.c,v 1.508 2002/09/21 14:50:04 andrey Exp $ */ +/* $Id: basic_functions.c,v 1.509 2002/09/23 17:27:37 wez Exp $ */ #include php.h #include php_streams.h -1051,6 +1051,7 php_unregister_url_stream_wrapper(ftp TSRMLS_CC); # if HAVE_OPENSSL_EXT php_unregister_url_stream_wrapper(https TSRMLS_CC); + php_unregister_url_stream_wrapper(ftps TSRMLS_CC); # endif #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended /ext/standard basic_functions.h file.c file.h http_fopen_wrapper.c /main network.c streams.c
wez Mon Sep 23 14:12:39 2002 EDT Modified files: /php4 php.ini-dist php.ini-recommended /php4/ext/standard basic_functions.h file.c file.h http_fopen_wrapper.c /php4/main network.c streams.c Log: Implement a default_socket_timeout and auto_detect_line_endings ini options. Also move user_agent from BG to FG. Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.154 php4/php.ini-dist:1.155 --- php4/php.ini-dist:1.154 Sat Sep 7 11:43:08 2002 +++ php4/php.ini-dist Mon Sep 23 14:12:38 2002 @@ -215,7 +215,6 @@ max_execution_time = 30 ; Maximum execution time of each script, in seconds memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) - ;; ; Error handling and logging ; ;; @@ -468,6 +467,16 @@ ; Define the User-Agent string ; user_agent=PHP + +; Default timeout for socket based streams (seconds) +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; auto_detect_line_endings = Off ;; Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.106 php4/php.ini-recommended:1.107 --- php4/php.ini-recommended:1.106 Sat Sep 7 11:43:08 2002 +++ php4/php.ini-recommendedMon Sep 23 14:12:38 2002 @@ -483,6 +483,17 @@ ; Define the user agent for php to send ;user_agent=PHP +; Default timeout for socket based streams (seconds) +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; auto_detect_line_endings = Off + + ;; ; Dynamic Extensions ; ;; Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.106 php4/ext/standard/basic_functions.h:1.107 --- php4/ext/standard/basic_functions.h:1.106 Sat Sep 7 11:45:29 2002 +++ php4/ext/standard/basic_functions.h Mon Sep 23 14:12:38 2002 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.h,v 1.106 2002/09/07 15:45:29 sterling Exp $ */ +/* $Id: basic_functions.h,v 1.107 2002/09/23 18:12:38 wez Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -141,9 +141,6 @@ HashTable sm_protected_env_vars; char *sm_allowed_env_vars; - - /* file.c */ - char *user_agent; /* pageinfo.c */ long page_uid; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.255 php4/ext/standard/file.c:1.256 --- php4/ext/standard/file.c:1.255 Sun Sep 22 21:47:01 2002 +++ php4/ext/standard/file.cMon Sep 23 14:12:38 2002 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.255 2002/09/23 01:47:01 wez Exp $ */ +/* $Id: file.c,v 1.256 2002/09/23 18:12:38 wez Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -157,7 +157,9 @@ PHP_INI_BEGIN() - STD_PHP_INI_ENTRY(user_agent, NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_basic_globals, basic_globals) + STD_PHP_INI_ENTRY(user_agent, NULL, PHP_INI_ALL, OnUpdateString, user_agent, +php_file_globals, file_globals) + STD_PHP_INI_ENTRY(default_socket_timeout, 60, PHP_INI_ALL, OnUpdateInt, +default_socket_timeout, php_file_globals, file_globals) + STD_PHP_INI_ENTRY(auto_detect_line_endings, 0, PHP_INI_ALL, OnUpdateInt, +auto_detect_line_endings, php_file_globals, file_globals) PHP_INI_END() PHP_MINIT_FUNCTION(file) Index: php4/ext/standard/file.h diff -u php4/ext/standard/file.h:1.62 php4/ext/standard/file.h:1.63 --- php4/ext/standard/file.h:1.62 Tue Aug 20 16:47:47 2002 +++ php4/ext/standard/file.hMon Sep 23 14:12:38 2002 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: file.h,v 1.62 2002/08/20 20:47:47 wez Exp $ */ +/* $Id: file.h,v 1.63 2002/09/23 18:12:38 wez Exp $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ @@ -115,6 +115,9 @@ int pclose_ret; HashTable ht_persistent_socks; size_t def_chunk_size; + int auto_detect_line_endings; + int default_socket_timeout; + char *user_agent; } php_file_globals; #ifdef ZTS Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.48 php4/ext/standard/http_fopen_wrapper.c:1.49
[PHP-CVS] cvs: php4 /ext/standard file.h
wez Mon Sep 23 14:13:31 2002 EDT Modified files: /php4/ext/standard file.h Log: WS Index: php4/ext/standard/file.h diff -u php4/ext/standard/file.h:1.63 php4/ext/standard/file.h:1.64 --- php4/ext/standard/file.h:1.63 Mon Sep 23 14:12:38 2002 +++ php4/ext/standard/file.hMon Sep 23 14:13:31 2002 -16,7 +16,7 +--+ */ -/* $Id: file.h,v 1.63 2002/09/23 18:12:38 wez Exp $ */ +/* $Id: file.h,v 1.64 2002/09/23 18:13:31 wez Exp $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ -100,21 +100,21 } php_meta_tags_token; typedef struct _php_meta_tags_data { - php_stream *stream; - int ulc; - int lc; - char *input_buffer; - char *token_data; - int token_len; - int in_meta; + php_stream *stream; + int ulc; + int lc; + char *input_buffer; + char *token_data; + int token_len; + int in_meta; } php_meta_tags_data; php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC); typedef struct { - int pclose_ret; - HashTable ht_persistent_socks; - size_t def_chunk_size; + int pclose_ret; + HashTable ht_persistent_socks; + size_t def_chunk_size; int auto_detect_line_endings; int default_socket_timeout; char *user_agent; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main php_streams.h
wez Mon Sep 23 15:07:38 2002 EDT Modified files: /php4/main php_streams.h Log: Enable include(http://;) under win32 by downloading to a temporary stream so that flex will get on nicely with the content. # untested; theoretically it should work just fine. Index: php4/main/php_streams.h diff -u php4/main/php_streams.h:1.46 php4/main/php_streams.h:1.47 --- php4/main/php_streams.h:1.46Mon Sep 23 10:50:20 2002 +++ php4/main/php_streams.h Mon Sep 23 15:07:38 2002 -467,7 +467,7 #define STREAM_LOCATE_WRAPPERS_ONLY64 #ifdef PHP_WIN32 -# define IGNORE_URL_WIN IGNORE_URL +# define IGNORE_URL_WIN STREAM_MUST_SEEK #else # define IGNORE_URL_WIN 0 #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/fribidi fribidi.c
tal Mon Sep 23 16:24:29 2002 EDT Modified files: /php4/ext/fribidi fribidi.c Log: - Fixed build on Win32 (and made the ext use a newer API) - Various CS fixes - Converted the parameter parsing to the new API Index: php4/ext/fribidi/fribidi.c diff -u php4/ext/fribidi/fribidi.c:1.21 php4/ext/fribidi/fribidi.c:1.22 --- php4/ext/fribidi/fribidi.c:1.21 Sat Sep 21 06:58:46 2002 +++ php4/ext/fribidi/fribidi.c Mon Sep 23 16:24:29 2002 -17,7 +17,7 +--+ */ -/* $Id: fribidi.c,v 1.21 2002/09/21 10:58:46 tal Exp $ */ +/* $Id: fribidi.c,v 1.22 2002/09/23 20:24:29 tal Exp $ */ #ifdef HAVE_CONFIG_H #include config.h -122,32 +122,29 Convert a logical string to a visual one */ PHP_FUNCTION(fribidi_log2vis) { - zval **parameter1, **parameter2, **parameter3; + zval **direction; + long charset; FriBidiChar *u_logical_str, *u_visual_str; /* unicode strings */ - char *inString, *outString; - int len, alloc_len, utf8_len; + char *v_str, *in_string, *out_string; + int len, alloc_len; FriBidiCharType base_dir; FriBidiStrIndex *position_L_to_V_list; FriBidiStrIndex *position_V_to_L_list; FriBidiLevel*embedding_level_list; - /* get parameters from input */ - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, parameter1, parameter2, parameter3) == FAILURE) { - WRONG_PARAM_COUNT; + /* parse parameters from input */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, szl, v_str, len, +direction, charset) == FAILURE) { + return; } - - /* convert input to expected type */ - convert_to_string_ex(parameter1); - convert_to_long_ex(parameter3); - - if (Z_TYPE_PP(parameter2) == IS_LONG) { - convert_to_long_ex(parameter2); - base_dir = Z_LVAL_PP(parameter2); - } else if (Z_TYPE_PP(parameter2) == IS_STRING) { - convert_to_string_ex(parameter2); - if ((Z_STRVAL_PP(parameter2))[0] == 'R') { + + if (Z_TYPE_PP(direction) == IS_LONG) { + convert_to_long_ex(direction); + base_dir = Z_LVAL_PP(direction); + } else if (Z_TYPE_PP(direction) == IS_STRING) { + convert_to_string_ex(direction); + if ((Z_STRVAL_PP(direction))[0] == 'R') { base_dir = FRIBIDI_TYPE_RTL; - } else if (Z_STRVAL_PP(parameter2)[0] == 'L') { + } else if (Z_STRVAL_PP(direction)[0] == 'L') { base_dir = FRIBIDI_TYPE_LTR; } else { base_dir = FRIBIDI_TYPE_ON; -157,8 +154,7 } /* allocate space and prepare all local variables */ - len = Z_STRLEN_PP(parameter1); - inString = estrndup(Z_STRVAL_PP(parameter1), len); + in_string = estrndup(v_str, len); alloc_len = len+1; u_logical_str = (FriBidiChar*) emalloc(sizeof(FriBidiChar)*alloc_len); -168,28 +164,18 position_V_to_L_list = (FriBidiStrIndex *) emalloc(sizeof(FriBidiStrIndex)*alloc_len); embedding_level_list = (FriBidiLevel *) emalloc(sizeof(FriBidiLevel)*alloc_len); - if(inString[len-1] == '\n') { - inString[len-1] = '\0'; + if(in_string[len-1] == '\n') { + in_string[len-1] = '\0'; } - switch(Z_LVAL_PP(parameter3)) { + switch(charset) { case FRIBIDI_CHARSET_UTF8: - utf8_len=fribidi_utf8_to_unicode(inString, len, u_logical_str); - break; case FRIBIDI_CHARSET_ISO8859_6: - fribidi_iso8859_6_to_unicode(inString, len, u_logical_str); - break; case FRIBIDI_CHARSET_ISO8859_8: - fribidi_iso8859_8_to_unicode(inString, len, u_logical_str); - break; case FRIBIDI_CHARSET_CP1255: - fribidi_cp1255_to_unicode(inString, len, u_logical_str); - break; case FRIBIDI_CHARSET_CP1256: - fribidi_cp1256_to_unicode(inString, len, u_logical_str); - break; case FRIBIDI_CHARSET_ISIRI_3342: - fribidi_isiri_3342_to_unicode(inString, len, u_logical_str); + len = fribidi_charset_to_unicode(charset, in_string, len, +u_logical_str); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown charset); -198,36 +184,26 efree(position_L_to_V_list); efree(position_V_to_L_list); efree(embedding_level_list); -
[PHP-CVS] cvs: php4(PHP_4_2_0) /ext/ldap ldap.c
sniper Mon Sep 23 19:22:09 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/ldap ldap.c Log: MFH: fix for bug #17915 Index: php4/ext/ldap/ldap.c diff -u php4/ext/ldap/ldap.c:1.116.2.1 php4/ext/ldap/ldap.c:1.116.2.2 --- php4/ext/ldap/ldap.c:1.116.2.1 Tue Apr 23 14:59:57 2002 +++ php4/ext/ldap/ldap.cMon Sep 23 19:22:08 2002 -22,7 +22,7 +--+ */ -/* $Id: ldap.c,v 1.116.2.1 2002/04/23 18:59:57 derick Exp $ */ +/* $Id: ldap.c,v 1.116.2.2 2002/09/23 23:22:08 sniper Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H -263,7 +263,7 php_info_print_table_start(); php_info_print_table_row(2, LDAP Support, enabled ); - php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.116.2.1 2002/04/23 18:59:57 derick Exp $ ); + php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.116.2.2 2002/09/23 +23:22:08 sniper Exp $ ); if (LDAPG(max_links) == -1) { snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links)); -2026,6 +2026,7 zval **cb_args[2]; zval *cb_retval; zval *cb_link = (zval *) params; + TSRMLS_FETCH(); ld = (ldap_linkdata *) zend_fetch_resource(cb_link TSRMLS_CC, -1, ldap link, NULL, 1, le_link); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /main streams.c
wez Mon Sep 23 19:39:46 2002 EDT Modified files: /php4/main streams.c Log: Correct a buglet in the newly introduced buffer code. # Andi: this might have been the cause of that problem you mentioned. Index: php4/main/streams.c diff -u php4/main/streams.c:1.80 php4/main/streams.c:1.81 --- php4/main/streams.c:1.80Mon Sep 23 15:10:33 2002 +++ php4/main/streams.c Mon Sep 23 19:39:46 2002 -20,7 +20,7 +--+ */ -/* $Id: streams.c,v 1.80 2002/09/23 19:10:33 wez Exp $ */ +/* $Id: streams.c,v 1.81 2002/09/23 23:39:46 wez Exp $ */ #define _GNU_SOURCE #include php.h -355,7 +355,8 stream-readbuflen - stream-writepos TSRMLS_CC); } - if (justread == 0) + + if (justread = 0) break; stream-writepos += justread; } -363,15 +364,15 PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS_DC) { - size_t avail, toread, didread = 0; + size_t toread, didread = 0; /* take from the read buffer first. * It is possible that a buffered stream was switched to non-buffered, so we * drain the remainder of the buffer before using the raw read mode for * the excess */ - avail = stream-writepos - stream-readpos; - if (avail) { - toread = avail; + if (stream-writepos stream-readpos) { + + toread = stream-writepos - stream-readpos; if (toread size) toread = size; -379,7 +380,7 stream-readpos += toread; size -= toread; buf += toread; - didread += size; + didread += toread; } if (size == 0) -398,10 +399,12 if ((off_t)size stream-writepos - stream-readpos) size = stream-writepos - stream-readpos; - - memcpy(buf, stream-readbuf + stream-readpos, size); - stream-readpos += size; - didread += size; + + if (size) { + memcpy(buf, stream-readbuf + stream-readpos, size); + stream-readpos += size; + didread += size; + } } stream-position += size; return didread; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 / NEWS
sniper Mon Sep 23 19:41:54 2002 EDT Modified files: /php4 NEWS Log: yadda yadda.. Index: php4/NEWS diff -u php4/NEWS:1.1131 php4/NEWS:1.1132 --- php4/NEWS:1.1131Mon Sep 23 15:16:03 2002 +++ php4/NEWS Mon Sep 23 19:41:54 2002 -1,12 +1,11 PHP 4 NEWS ||| ? ? ??? 2002, Version 4.3.0 -- include and require now work with remote files under win32. (Wez) +- Fixed include() and require() to work with remote files under win32. (Wez) - Added php.ini option auto_detect_line_endings which enables PHP to detect Macintosh, Unix and Dos end-of-line characters in fgets() and file(). Fixes Bug #16521. (Wez) -- Fixed compilation errors when compiling with the fribidi extension. - (Bug #16414) (Tal) +- Fixed compile errors in the FriBidi extension (Bug #16414). (Tal) - Fixed bugs #7472, #12120 and #12989 as well as other potential problems with strip_tags() function. (Ilia) - Upgraded PCRE to version 3.9. (Wez) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php