Changeset 431
- Timestamp:
- 07/08/2005 10:29:40 PM (3 years ago)
- Location:
- branches/lighttpd-1.3.x/src
- Files:
-
- 3 modified
-
mod_cml.h (modified) (1 diff)
-
mod_cml_funcs.c (modified) (3 diffs)
-
mod_cml_logic.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.3.x/src/mod_cml.h
r428 r431 87 87 CACHE_FUNC_PROTO(f_unix_time_now); 88 88 CACHE_FUNC_PROTO(f_file_mtime); 89 CACHE_FUNC_PROTO(f_mysql_escape); 90 CACHE_FUNC_PROTO(f_mysql_connect); 91 CACHE_FUNC_PROTO(f_mysql_query); 89 CACHE_FUNC_PROTO(f_memcache_get); 90 CACHE_FUNC_PROTO(f_memcache_exists); 92 91 93 92 #endif -
branches/lighttpd-1.3.x/src/mod_cml_funcs.c
r428 r431 62 62 } 63 63 64 CACHE_FUNC_PROTO(f_m ysql_escape) {64 CACHE_FUNC_PROTO(f_memcache_exists) { 65 65 UNUSED(srv); 66 66 UNUSED(con); … … 68 68 if (p->params->ptr[0]->type != T_NODE_VALUE_STRING) { 69 69 log_error_write(srv, __FILE__, __LINE__, "sd", 70 "f_m ysql_escape: I need a string:",70 "f_memcache_exists: I need a string:", 71 71 p->params->ptr[0]->type); 72 72 73 return -1;74 }75 76 tnode_prepare_string(result);77 buffer_copy_string_buffer(VAL_STRING(result), p->params->ptr[0]->data.str);78 79 return 0;80 }81 82 CACHE_FUNC_PROTO(f_mysql_query) {83 UNUSED(srv);84 UNUSED(con);85 86 if (p->params->ptr[0]->type != T_NODE_VALUE_STRING) {87 log_error_write(srv, __FILE__, __LINE__, "sd",88 "f_mysql_query: I need a string:",89 p->params->ptr[0]->type);90 73 return -1; 91 74 } … … 97 80 } 98 81 99 CACHE_FUNC_PROTO(f_m ysql_connect) {82 CACHE_FUNC_PROTO(f_memcache_get) { 100 83 UNUSED(srv); 101 84 UNUSED(con); 102 85 103 if (p->params->ptr[0]->type != T_NODE_VALUE_STRING) return -1; 104 if (p->params->ptr[1]->type != T_NODE_VALUE_STRING) return -1; 105 if (p->params->ptr[2]->type != T_NODE_VALUE_STRING) return -1; 106 if (p->params->ptr[3]->type != T_NODE_VALUE_STRING) return -1; 86 if (p->params->ptr[0]->type != T_NODE_VALUE_STRING) { 87 log_error_write(srv, __FILE__, __LINE__, "sd", 88 "f_memcache_get: I need a string:", 89 p->params->ptr[0]->type); 90 return -1; 91 } 107 92 108 tnode_prepare_ long(result);109 VAL_LONG(result) = 0;93 tnode_prepare_string(result); 94 buffer_copy_string_buffer(VAL_STRING(result), p->params->ptr[0]->data.str); 110 95 111 96 return 0; 112 97 } 113 -
branches/lighttpd-1.3.x/src/mod_cml_logic.c
r428 r431 164 164 165 165 cache_trigger_functions f[] = { 166 { "file.mtime", 1, f_file_mtime }, 167 { "unix.time.now", 0, f_unix_time_now }, 168 { "mysql.escape", 1, f_mysql_escape }, 169 { "mysql.connect", 4, f_mysql_connect }, 170 { "mysql.query", 1, f_mysql_query }, 166 { "file.mtime", 1, f_file_mtime }, 167 { "unix.time.now", 0, f_unix_time_now }, 168 { "memcache.exits", 1, f_memcache_exists }, 169 { "memcache.get", 1, f_memcache_get }, 171 170 { NULL, 0, NULL }, 172 171 }; … … 341 340 342 341 /* parse parameters */ 342 343 tnode_val_array_reset(p->params); 343 344 344 345 if (0 != cache_parse_parameters(srv, con, p, br_open + 1, t->used - slen - 3, p->params)) {

