thies Thu Feb 15 06:48:59 2001 EDT
Modified files:
/php4/ext/cpdf cpdf.c
/php4/ext/gd gd.c gd_ctx.c
/php4/ext/hyperwave hw.c
/php4/ext/interbase interbase.c
/php4/ext/oci8 oci8.c
/php4/ext/pdf pdf.c
/php4/ext/standard file.c iptc.c
Log:
@- Fixed some modules to allow using output-buffering. (Thies)
i nuked all unneded calls to php_header() - i'm not too sure how we do
handle HEAD Requests as they were only detected via php_header(). but calling
php_header from a module makes output-buffering unusable.
NOTICE: there is some EBSDIC stuff in gd.c - i think it's obsolete.
Index: php4/ext/cpdf/cpdf.c
diff -u php4/ext/cpdf/cpdf.c:1.21 php4/ext/cpdf/cpdf.c:1.22
--- php4/ext/cpdf/cpdf.c:1.21 Wed Oct 25 10:43:49 2000
+++ php4/ext/cpdf/cpdf.c Thu Feb 15 06:48:56 2001
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cpdf.c,v 1.21 2000/10/25 17:43:49 andrei Exp $ */
+/* $Id: cpdf.c,v 1.22 2001/02/15 14:48:56 thies Exp $ */
/* cpdflib.h -- C language API definitions for ClibPDF library
* Copyright (C) 1998 FastIO Systems, All Rights Reserved.
*/
@@ -2226,7 +2226,7 @@
}
buffer = cpdf_getBufferForPDF(pdf, &lenght);
- php_header();
+
php_write(buffer, lenght);
RETURN_TRUE;
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.114 php4/ext/gd/gd.c:1.115
--- php4/ext/gd/gd.c:1.114 Fri Feb 9 13:14:30 2001
+++ php4/ext/gd/gd.c Thu Feb 15 06:48:56 2001
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.114 2001/02/09 21:14:30 hholzgra Exp $ */
+/* $Id: gd.c,v 1.115 2001/02/15 14:48:56 thies Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -853,33 +853,35 @@
php_error(E_WARNING, "%s: unable to open temporary file",
get_active_function_name());
RETURN_FALSE;
}
- output = php_header();
- if (output) {
- switch(image_type) {
- case PHP_GDIMG_TYPE_JPG:
- (*func_p)(im, tmp, q);
- break;
- case PHP_GDIMG_TYPE_WBM:
- if(q<0||q>255) {
- php_error(E_WARNING, "%s: invalid
threshold value '%d'. It must be between 0 and 255",get_active_function_name(), q);
- }
- (*func_p)(im, q, tmp);
- break;
- default:
- (*func_p)(im, tmp);
- break;
- }
+
+ switch(image_type) {
+ case PHP_GDIMG_TYPE_JPG:
+ (*func_p)(im, tmp, q);
+ break;
+ case PHP_GDIMG_TYPE_WBM:
+ if(q<0||q>255) {
+ php_error(E_WARNING, "%s: invalid threshold
+value '%d'. It must be between 0 and 255",get_active_function_name(), q);
+ }
+ (*func_p)(im, q, tmp);
+ break;
+ default:
+ (*func_p)(im, tmp);
+ break;
+ }
+
+ fseek(tmp, 0, SEEK_SET);
- fseek(tmp, 0, SEEK_SET);
#if APACHE && defined(CHARSET_EBCDIC)
- SLS_FETCH();
- /* This is a binary file already: avoid EBCDIC->ASCII conversion */
- ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
-#endif
- while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) {
- php_write(buf, b);
- }
- }
+ /* XXX this is unlikely to work any more [EMAIL PROTECTED] */
+
+ SLS_FETCH();
+ /* This is a binary file already: avoid EBCDIC->ASCII conversion */
+ ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
+#endif
+ while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) {
+ php_write(buf, b);
+ }
+
fclose(tmp);
/* the temporary file is automatically deleted */
}
Index: php4/ext/gd/gd_ctx.c
diff -u php4/ext/gd/gd_ctx.c:1.1 php4/ext/gd/gd_ctx.c:1.2
--- php4/ext/gd/gd_ctx.c:1.1 Thu Feb 1 07:40:35 2001
+++ php4/ext/gd/gd_ctx.c Thu Feb 15 06:48:56 2001
@@ -61,15 +61,13 @@
ctx = gdNewFileCtx(fp);
} else {
- if(!php_header()) {
- RETURN_TRUE;
- }
ctx = emalloc(sizeof(gdIOCtx));
ctx->putC = _php_image_output_putc;
ctx->putBuf = _php_image_output_putbuf;
ctx->free = _php_image_output_ctxfree;
#if APACHE && defined(CHARSET_EBCDIC)
+ /* XXX this is unlikely to work any more [EMAIL PROTECTED] */
SLS_FETCH();
/* This is a binary file already: avoid EBCDIC->ASCII conversion */
ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.74 php4/ext/hyperwave/hw.c:1.75
--- php4/ext/hyperwave/hw.c:1.74 Fri Jan 26 13:22:32 2001
+++ php4/ext/hyperwave/hw.c Thu Feb 15 06:48:56 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.74 2001/01/26 21:22:32 eschmid Exp $ */
+/* $Id: hw.c,v 1.75 2001/02/15 14:48:56 thies Exp $ */
#include <stdlib.h>
#include <errno.h>
@@ -2766,8 +2766,7 @@
RETURN_FALSE;
}
- if(php_header())
- php_write(ptr->data, ptr->size);
+ php_write(ptr->data, ptr->size);
RETURN_TRUE;
}
Index: php4/ext/interbase/interbase.c
diff -u php4/ext/interbase/interbase.c:1.49 php4/ext/interbase/interbase.c:1.50
--- php4/ext/interbase/interbase.c:1.49 Thu Jan 4 03:15:35 2001
+++ php4/ext/interbase/interbase.c Thu Feb 15 06:48:56 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.49 2001/01/04 11:15:35 jah Exp $ */
+/* $Id: interbase.c,v 1.50 2001/02/15 14:48:56 thies Exp $ */
/* TODO: Arrays, roles?
@@ -596,7 +596,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.49 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.50 $");
#ifdef COMPILE_DL_INTERBASE
php_info_print_table_row(2, "Dynamic Module", "yes");
#endif
@@ -2831,10 +2831,6 @@
GET_BLOB_ID_ARG(blob_arg, ib_blob_id);
- if (!php_header()) {
- RETURN_FALSE;
- }
-
if (ib_blob_id) { /*not null ?*/
if (isc_open_blob(IB_STATUS, &ib_blob_id->link,
&ib_blob_id->trans_handle,
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.107 php4/ext/oci8/oci8.c:1.108
--- php4/ext/oci8/oci8.c:1.107 Wed Feb 14 05:06:03 2001
+++ php4/ext/oci8/oci8.c Thu Feb 15 06:48:57 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.107 2001/02/14 13:06:03 thies Exp $ */
+/* $Id: oci8.c,v 1.108 2001/02/15 14:48:57 thies Exp $ */
/* TODO list:
*
@@ -489,7 +489,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.107 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.108 $");
#ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -834,9 +834,7 @@
vsnprintf(buffer, sizeof(buffer)-1, format, args);
va_end(args);
buffer[sizeof(buffer)-1] = '\0';
- if (php_header()) {
- php_printf("OCIDebug: %s<br>\n", buffer);
- }
+ php_printf("OCIDebug: %s<br>\n", buffer);
}
}
@@ -2959,9 +2957,7 @@
goto bail;
}
} else {
- if (php_header()) {
- PHPWRITE(buffer,toread);
- }
+ PHPWRITE(buffer,toread);
}
length -= toread;
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.70 php4/ext/pdf/pdf.c:1.71
--- php4/ext/pdf/pdf.c:1.70 Mon Feb 12 09:50:38 2001
+++ php4/ext/pdf/pdf.c Thu Feb 15 06:48:57 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdf.c,v 1.70 2001/02/12 17:50:38 rjs Exp $ */
+/* $Id: pdf.c,v 1.71 2001/02/15 14:48:57 thies Exp $ */
/* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -250,7 +250,7 @@
static size_t pdf_flushwrite(PDF *p, void *data, size_t size)
{
- if(php_header()) return(php_write(data, size));
+ return(php_write(data, size));
return 0;
}
@@ -264,7 +264,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "PDF Support", "enabled" );
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
- php_info_print_table_row(2, "Revision", "$Revision: 1.70 $" );
+ php_info_print_table_row(2, "Revision", "$Revision: 1.71 $" );
php_info_print_table_end();
}
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.139 php4/ext/standard/file.c:1.140
--- php4/ext/standard/file.c:1.139 Sat Feb 10 18:38:40 2001
+++ php4/ext/standard/file.c Thu Feb 15 06:48:58 2001
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.139 2001/02/11 02:38:40 elixer Exp $ */
+/* $Id: file.c,v 1.140 2001/02/15 14:48:58 thies Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1437,9 +1437,7 @@
rsrc_id = ZEND_REGISTER_RESOURCE(NULL,fp,php_file_le_fopen());
}
- if (php_header()) {
- size = php_passthru_fd(socketd, fp, issock);
- }
+ size = php_passthru_fd(socketd, fp, issock);
zend_list_delete(rsrc_id);
@@ -1497,12 +1495,10 @@
socketd=*(int*)what;
}
- size = 0;
- if (php_header()) { /* force headers if not already sent */
- size = php_passthru_fd(socketd, (FILE*) what, issock);
- }
+ size = php_passthru_fd(socketd, (FILE*) what, issock);
zend_list_delete((*arg1)->value.lval);
+
RETURN_LONG(size);
}
/* }}} */
Index: php4/ext/standard/iptc.c
diff -u php4/ext/standard/iptc.c:1.24 php4/ext/standard/iptc.c:1.25
--- php4/ext/standard/iptc.c:1.24 Sun Oct 29 01:14:53 2000
+++ php4/ext/standard/iptc.c Thu Feb 15 06:48:58 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iptc.c,v 1.24 2000/10/29 09:14:53 thies Exp $ */
+/* $Id: iptc.c,v 1.25 2001/02/15 14:48:58 thies Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -202,16 +202,6 @@
php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val);
RETURN_FALSE;
}
-
- if (spool > 0)
- if (!php_header()){ /* we got a HEAD request. */
- if (spool == 2){
- RETURN_TRUE; /* we only wanted to spool - report
success. */
- } else
- if (spool == 1) {
- spool = 0; /* we wanted the file to be
spooled/returned, just return it */
- }
- }
len = (*iptcdata)->value.str.len;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]