cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Tue, 29 Apr 2003 07:31:21 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20576@lists.php.net to get a copy of this message | ||
sas Tue Apr 29 03:31:21 2003 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Add a warning to ircg_set_current() similar to session_start()
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.183 php4/ext/ircg/ircg.c:1.184
--- php4/ext/ircg/ircg.c:1.183 Tue Apr 29 02:43:55 2003
+++ php4/ext/ircg/ircg.c Tue Apr 29 03:31:21 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.183 2003/04/29 06:43:55 sas Exp $ */
+/* $Id: ircg.c,v 1.184 2003/04/29 07:31:21 sas Exp $ */
/* {{{ includes */
@@ -1157,13 +1157,31 @@
WRONG_PARAM_COUNT;
convert_to_long_ex(p1);
+
+ RETVAL_FALSE;
+
+ if (SG(headers_sent)) {
+ char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
+ int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
+
+ if (output_start_filename) {
+ php_error(E_WARNING, "Please ensure that ircg_set_current is "
+ "called before your script generates any output. "
+ "(output started at %s:%d)",
+ output_start_filename, output_start_lineno);
+ } else {
+ php_error(E_WARNING, "Please ensure that ircg_set_current is "
+ "called before your script generates any output");
+ }
+ return;
+ }
conn = lookup_irconn(Z_LVAL_PP(p1));
- RETVAL_FALSE;
if (!conn) return;
+
if (conn->fd >= 0) {
#ifdef USE_FD2IRCONN
/* There is a HTTP connection alive, kill it */