cvs: php4 /ext/ircg ircg.c ircg_scanner.c ircg_scanner.re php_ircg_cache.c php_ircg_cache.h php_ircg_conversion.c php_ircg_error.c php_ircg_private.h
php_ircg_smart_str.h php_ircg_tokenizer.c php_ircg_tokenizer.h

From: Date: Sat, 19 Apr 2003 18:03:48 +0000
Subject: cvs: php4 /ext/ircg ircg.c ircg_scanner.c ircg_scanner.re php_ircg_cache.c php_ircg_cache.h php_ircg_conversion.c php_ircg_error.c php_ircg_private.h
php_ircg_smart_str.h php_ircg_tokenizer.c php_ircg_tokenizer.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20397@lists.php.net to get a copy of this message
sas Sat Apr 19 14:03:48 2003 EDT Added files: /php4/ext/ircg php_ircg_smart_str.h Modified files: /php4/ext/ircg ircg.c ircg_scanner.c ircg_scanner.re php_ircg_cache.c php_ircg_cache.h php_ircg_conversion.c php_ircg_error.c php_ircg_private.h php_ircg_tokenizer.c php_ircg_tokenizer.h Log: Improve phpinfo output a bit Use IRCG's smart_str header only--not sure how this has ever worked before (allocation of memory on the heap vs. shared memory)

Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.168 php4/ext/ircg/ircg.c:1.169 --- php4/ext/ircg/ircg.c:1.168 Tue Apr 1 05:56:46 2003 +++ php4/ext/ircg/ircg.c Sat Apr 19 14:03:47 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.168 2003/04/01 10:56:46 sas Exp $ */ +/* $Id: ircg.c,v 1.169 2003/04/19 18:03:47 sas Exp $ */ /* {{{ includes */ @@ -64,7 +64,7 @@ #include "php_ircg_error.h" #include "php_ircg_tokenizer.h" -#include "ext/standard/php_smart_str.h" +#include "php_ircg_smart_str.h" #include "php_ircg_private.h" #ifdef USE_IRCONN_MANAGEMENT @@ -1015,6 +1015,7 @@ static void wbuf_closed_conn(irc_write_buf *p, void *data) { + php_ircg->irc_wbuf_destructs++; irc_disconnect(data, "Client connection terminated"); } @@ -1732,6 +1733,7 @@ php_fmt_msgs_t *fmt_msgs = NULL; php_irconn_t *conn; int bailout_on_trivial = 1; + int concurrency; if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 7 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, &p5, &p6, &p7) == FAILURE) @@ -1795,7 +1797,12 @@ IRCG_SHARED_FREE(conn); RETURN_FALSE; } - php_ircg->irc_connects++; + + concurrency = ++php_ircg->irc_connects - php_ircg->irc_quit_handlers; + + if (concurrency > php_ircg->max_concurrency) + php_ircg->max_concurrency = concurrency; + ircg_hash_init(&conn->ctcp_msgs, 10, NULL, (dtor_func_t) ctcp_msgs_dtor, 1); if (p5 && Z_TYPE_PP(p5) == IS_ARRAY) { ircg_copy_ctcp_msgs(p5, conn); @@ -2224,17 +2231,19 @@ #endif php_info_print_table_start(); - php_info_print_table_header(2, "ircg support", "enabled"); + php_info_print_table_header(2, "Property", "Value"); + sprintf(buf, "%lu", php_ircg->max_concurrency); + php_info_print_table_row(2, "Maximum concurrent IRC connections", buf); sprintf(buf, "%lu", php_ircg->cache_hits); php_info_print_table_row(2, "Scanner result cache hits", buf); sprintf(buf, "%lu", php_ircg->cache_misses); php_info_print_table_row(2, "Scanner result cache misses", buf); sprintf(buf, "%lu", php_ircg->exec_fmt_msgs); - php_info_print_table_row(2, "Executed format messages", buf); + php_info_print_table_row(2, "Handled format messages", buf); sprintf(buf, "%lu", php_ircg->exec_token_compiler); php_info_print_table_row(2, "Tokenizer invocations", buf); sprintf(buf, "%lu", php_ircg->irc_connects); - php_info_print_table_row(2, "IRC connects", buf); + php_info_print_table_row(2, "Initiated IRC connections", buf); sprintf(buf, "%lu", php_ircg->irc_quit_handlers); php_info_print_table_row(2, "Terminated IRC connections", buf); sprintf(buf, "%lu", php_ircg->irc_set_currents); @@ -2245,16 +2254,20 @@ php_info_print_table_row(2, "Write buffer destructs", buf); #if IRCG_API_VERSION >= 20021127 - + + php_info_print_table_end(); + php_info_print_table_start(); + php_info_print_table_header(2, "IRCG 4 Property", "Value"); + for (i = 0; i < IRCG_LOG_CNT_NR; i++) { ircg_log_get(i, &val, &name); sprintf(buf, IRCG_LOG_INT_FMT, val); - php_info_print_table_row(2, name, buf); + php_info_print_table_row_ex(2, "vr", name, buf); } #endif - php_info_print_table_end(); + DISPLAY_INI_ENTRIES(); } @@ -2264,7 +2277,7 @@ static void setup(int stage) { if (stage == 0) { - ircg_fetch_area("php-ircg-main", &php_ircg, sizeof *php_ircg, init); + ircg_fetch_area("php-ircg-main", (void **) &php_ircg, sizeof *php_ircg, init); ircg_register_relocation_map("php_ircg_msg_handler", php_ircg_cb_msg); ircg_register_relocation_map("php_ircg_wbuf_handler", php_ircg_cb_wbuf); Index: php4/ext/ircg/ircg_scanner.c diff -u php4/ext/ircg/ircg_scanner.c:1.23 php4/ext/ircg/ircg_scanner.c:1.24 --- php4/ext/ircg/ircg_scanner.c:1.23 Tue Jan 28 07:18:20 2003 +++ php4/ext/ircg/ircg_scanner.c Sat Apr 19 14:03:47 2003 @@ -1,5 +1,5 @@ -/* Generated by re2c 0.5 on Tue Jan 28 13:12:19 2003 */ -#line 1 "ircg_scanner.re" +/* Generated by re2c 0.5 on Sat Apr 19 08:52:05 2003 */ +#line 1 "/home/sas/src/php4/ext/ircg/ircg_scanner.re" /* +----------------------------------------------------------------------+ | PHP Version 4 | @@ -18,11 +18,11 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg_scanner.c,v 1.23 2003/01/28 12:18:20 sas Exp $ */ +/* $Id: ircg_scanner.c,v 1.24 2003/04/19 18:03:47 sas Exp $ */ #include "php_ircg_alloc.h" -#include <ext/standard/php_smart_str.h> +#include "php_ircg_smart_str.h" #include <stdio.h> #include <string.h> Index: php4/ext/ircg/ircg_scanner.re diff -u php4/ext/ircg/ircg_scanner.re:1.21 php4/ext/ircg/ircg_scanner.re:1.22 --- php4/ext/ircg/ircg_scanner.re:1.21 Tue Jan 28 07:12:42 2003 +++ php4/ext/ircg/ircg_scanner.re Sat Apr 19 14:03:47 2003 @@ -16,11 +16,11 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg_scanner.re,v 1.21 2003/01/28 12:12:42 sas Exp $ */ +/* $Id: ircg_scanner.re,v 1.22 2003/04/19 18:03:47 sas Exp $ */ #include "php_ircg_alloc.h" -#include <ext/standard/php_smart_str.h> +#include "php_ircg_smart_str.h" #include <stdio.h> #include <string.h> Index: php4/ext/ircg/php_ircg_cache.c diff -u php4/ext/ircg/php_ircg_cache.c:1.1 php4/ext/ircg/php_ircg_cache.c:1.2 --- php4/ext/ircg/php_ircg_cache.c:1.1 Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/php_ircg_cache.c Sat Apr 19 14:03:47 2003 @@ -4,7 +4,7 @@ #include "php_ircg_alloc.h" #include "php_ircg_cache.h" -#include "ext/standard/php_smart_str.h" +#include "php_ircg_smart_str.h" /* This is an expensive operation in terms of CPU time. We try to spend as little time in it by caching messages which Index: php4/ext/ircg/php_ircg_cache.h diff -u php4/ext/ircg/php_ircg_cache.h:1.1 php4/ext/ircg/php_ircg_cache.h:1.2 --- php4/ext/ircg/php_ircg_cache.h:1.1 Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/php_ircg_cache.h Sat Apr 19 14:03:47 2003 @@ -3,7 +3,7 @@ #include "php.h" #include "ext/standard/basic_functions.h" -#include "ext/standard/php_smart_str_public.h" +#include "ircg_smart_str_public.h" struct cache_entry { php_uint32 h; Index: php4/ext/ircg/php_ircg_conversion.c diff -u php4/ext/ircg/php_ircg_conversion.c:1.1 php4/ext/ircg/php_ircg_conversion.c:1.2 --- php4/ext/ircg/php_ircg_conversion.c:1.1 Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/php_ircg_conversion.c Sat Apr 19 14:03:47 2003 @@ -1,5 +1,5 @@ #include "php_ircg_alloc.h" -#include "ext/standard/php_smart_str.h" +#include "php_ircg_smart_str.h" /* {{{ Escape functions */ void php_ircg_js_escape(smart_str *input, smart_str *output) Index: php4/ext/ircg/php_ircg_error.c diff -u php4/ext/ircg/php_ircg_error.c:1.1 php4/ext/ircg/php_ircg_error.c:1.2 --- php4/ext/ircg/php_ircg_error.c:1.1 Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/php_ircg_error.c Sat Apr 19 14:03:47 2003 @@ -1,7 +1,7 @@ #include "php_ircg_private.h" #include "php_ircg_alloc.h" #include "php_ircg_error.h" -#include "ext/standard/php_smart_str.h" +#include "php_ircg_smart_str.h" #include <time.h> /* {{{ Post-connection error-storage */ Index: php4/ext/ircg/php_ircg_private.h diff -u php4/ext/ircg/php_ircg_private.h:1.5 php4/ext/ircg/php_ircg_private.h:1.6 --- php4/ext/ircg/php_ircg_private.h:1.5 Mon Dec 9 07:42:28 2002 +++ php4/ext/ircg/php_ircg_private.h Sat Apr 19 14:03:47 2003 @@ -39,7 +39,7 @@ /* these just serve statistical/entertainment purposes */ unsigned long irc_connects, irc_set_currents, irc_quit_handlers, exec_fmt_msgs, exec_token_compiler, - irc_wbuf_destructs, failed_set_currents; + irc_wbuf_destructs, failed_set_currents, max_concurrency; unsigned long cache_hits, cache_misses; Index: php4/ext/ircg/php_ircg_tokenizer.c diff -u php4/ext/ircg/php_ircg_tokenizer.c:1.1 php4/ext/ircg/php_ircg_tokenizer.c:1.2 --- php4/ext/ircg/php_ircg_tokenizer.c:1.1 Tue Dec 3 05:13:36 2002 +++ php4/ext/ircg/php_ircg_tokenizer.c Sat Apr 19 14:03:48 2003 @@ -1,14 +1,13 @@ #include "php_ircg_private.h" #include "php_ircg_alloc.h" #include "php_ircg_conversion.h" -#include "ext/standard/php_smart_str.h" +#include "php_ircg_smart_str.h" /* {{{ token_compiler */ #include "php_ircg_tokenizer.h" #include "php_ircg_alloc.h" -#include "ext/standard/php_smart_str.h" #define NEW_TOKEN(a, b) \ if (n + 1 >= alloced) { \ Index: php4/ext/ircg/php_ircg_tokenizer.h diff -u php4/ext/ircg/php_ircg_tokenizer.h:1.2 php4/ext/ircg/php_ircg_tokenizer.h:1.3 --- php4/ext/ircg/php_ircg_tokenizer.h:1.2 Mon Dec 9 07:42:28 2002 +++ php4/ext/ircg/php_ircg_tokenizer.h Sat Apr 19 14:03:48 2003 @@ -1,7 +1,7 @@ #ifndef PHP_IRCG_TOKENIZER_H #define PHP_IRCG_TOKENIZER_H -#include "ext/standard/php_smart_str_public.h" +#include "ircg_smart_str_public.h" typedef struct { unsigned char code; Index: php4/ext/ircg/php_ircg_smart_str.h +++ php4/ext/ircg/php_ircg_smart_str.h #ifndef PHP_IRCG_SMART_STR_H #define PHP_IRCG_SMART_STR_H #include "ircg_smart_str.h" #define smart_str_free_ex(a,b) smart_str_free((a)) #define smart_str_appendl_ex(a,b,c,d) smart_str_appendl((a),(b),(c)) #define smart_str_appendc_ex(a,b,c) smart_str_appendc((a),(b)) #define smart_str_append_ex(a,b,c) smart_str_append((a),(b)) #define smart_str_appends_ex(a,b,c) smart_str_appends_ex((a),(b)) #endif
« previous php.cvs (#20397) next »