本文整理汇总了C++中DBG_INF_FMT函数的典型用法代码示例。如果您正苦于以下问题:C++ DBG_INF_FMT函数的具体用法?C++ DBG_INF_FMT怎么用?C++ DBG_INF_FMT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DBG_INF_FMT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mysqlnd_caching_sha2_get_auth_data
/* {{{ mysqlnd_native_auth_get_auth_data */
static zend_uchar *
mysqlnd_caching_sha2_get_auth_data(struct st_mysqlnd_authentication_plugin * self,
size_t * auth_data_len,
MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd,
const size_t passwd_len, zend_uchar * auth_plugin_data, const size_t auth_plugin_data_len,
const MYSQLND_SESSION_OPTIONS * const session_options,
const MYSQLND_PFC_DATA * const pfc_data,
const zend_ulong mysql_flags
)
{
zend_uchar * ret = NULL;
DBG_ENTER("mysqlnd_caching_sha2_get_auth_data");
DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data);
*auth_data_len = 0;
DBG_INF("First auth step: send hashed password");
/* copy scrambled pass*/
if (passwd && passwd_len) {
ret = malloc(SHA256_LENGTH + 1);
*auth_data_len = SHA256_LENGTH;
php_mysqlnd_scramble_sha2((zend_uchar*)ret, auth_plugin_data, (zend_uchar*)passwd, passwd_len);
ret[SHA256_LENGTH] = '\0';
DBG_INF_FMT("hash(%d)=[%.*s]", *auth_data_len, *auth_data_len, ret);
}
DBG_RETURN(ret);
}
示例2: mysqlnd_result_meta_init
/* {{{ mysqlnd_result_meta_init */
PHPAPI MYSQLND_RES_METADATA *
mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_METADATA) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
DBG_ENTER("mysqlnd_result_meta_init");
DBG_INF_FMT("persistent=%u", persistent);
do {
if (!ret) {
break;
}
ret->m = & mysqlnd_mysqlnd_res_meta_methods;
ret->persistent = persistent;
ret->field_count = field_count;
/* +1 is to have empty marker at the end */
ret->fields = mnd_pecalloc(field_count + 1, sizeof(MYSQLND_FIELD), ret->persistent);
ret->zend_hash_keys = mnd_pecalloc(field_count, sizeof(struct mysqlnd_field_hash_key), ret->persistent);
if (!ret->fields || !ret->zend_hash_keys) {
break;
}
DBG_INF_FMT("meta=%p", ret);
DBG_RETURN(ret);
} while (0);
if (ret) {
ret->m->free_metadata(ret);
}
DBG_RETURN(NULL);
}
示例3: _mysqlnd_emalloc
/* {{{ _mysqlnd_emalloc */
void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D)
{
void *ret;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold);
#endif
DBG_ENTER(mysqlnd_emalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = emalloc(REAL_SIZE(size));
#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
}
#endif
DBG_INF_FMT("size=%lu ptr=%p", size, ret);
if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_EMALLOC_COUNT, 1, STAT_MEM_EMALLOC_AMOUNT, size);
}
DBG_RETURN(FAKE_PTR(ret));
}
示例4: _mysqlnd_pecalloc
/* {{{ _mysqlnd_pecalloc */
void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D)
{
void *ret;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
#if PHP_DEBUG
long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold);
#endif
DBG_ENTER(mysqlnd_pecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = pecalloc(nmemb, REAL_SIZE(size), persistent);
#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
}
#endif
DBG_INF_FMT("size=%lu ptr=%p", size, ret);
if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? STAT_MEM_CALLOC_COUNT:STAT_MEM_ECALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? STAT_MEM_CALLOC_AMOUNT:STAT_MEM_ECALLOC_AMOUNT;
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(s1, 1, s2, size);
}
DBG_RETURN(FAKE_PTR(ret));
}
示例5: _mysqlnd_perealloc
/* {{{ _mysqlnd_perealloc */
void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D)
{
void *ret;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0;
#if PHP_DEBUG
long * threshold = persistent? &MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold);
#endif
DBG_ENTER(mysqlnd_perealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent);
#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = perealloc(REAL_PTR(ptr), REAL_SIZE(new_size), persistent);
#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
}
#endif
DBG_INF_FMT("new_ptr=%p", (char*)ret);
if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? STAT_MEM_REALLOC_COUNT:STAT_MEM_EREALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? STAT_MEM_REALLOC_AMOUNT:STAT_MEM_EREALLOC_AMOUNT;
*(size_t *) ret = new_size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(s1, 1, s2, new_size);
}
DBG_RETURN(FAKE_PTR(ret));
}
示例6: MYSQLND_METHOD
/* {{{ mysqlnd_res_meta::fetch_field_direct */
static const MYSQLND_FIELD *
MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field_direct");
DBG_INF_FMT("fieldnr=%u", fieldnr);
DBG_INF_FMT("name=%s max_length=%u",
meta->fields[meta->current_field].name? meta->fields[meta->current_field].name:"",
meta->fields[meta->current_field].max_length);
DBG_RETURN(&meta->fields[fieldnr]);
}
示例7: MYSQLND_METHOD
/* {{{ mysqlnd_object_factory::get_io_channel */
PHPAPI MYSQLND_NET *
MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
size_t net_alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
size_t net_data_alloc_size = sizeof(MYSQLND_NET_DATA) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_NET * net = mnd_pecalloc(1, net_alloc_size, persistent);
MYSQLND_NET_DATA * net_data = mnd_pecalloc(1, net_data_alloc_size, persistent);
DBG_ENTER("mysqlnd_object_factory::get_io_channel");
DBG_INF_FMT("persistent=%u", persistent);
if (net && net_data) {
net->data = net_data;
net->persistent = net->data->persistent = persistent;
net->data->m = *mysqlnd_net_get_methods();
if (PASS != net->data->m.init(net, stats, error_info)) {
net->data->m.dtor(net, stats, error_info);
net = NULL;
}
} else {
if (net_data) {
mnd_pefree(net_data, persistent);
net_data = NULL;
}
if (net) {
mnd_pefree(net, persistent);
net = NULL;
}
}
DBG_RETURN(net);
}
示例8: mysqlnd_stmt_execute_generate_request
/* {{{ mysqlnd_stmt_execute_generate_request */
enum_func_status
mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer)
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar *p = stmt->execute_cmd_buffer.buffer,
*cmd_buffer = stmt->execute_cmd_buffer.buffer;
size_t cmd_buffer_length = stmt->execute_cmd_buffer.length;
enum_func_status ret;
DBG_ENTER("mysqlnd_stmt_execute_generate_request");
int4store(p, stmt->stmt_id);
p += 4;
/* flags is 4 bytes, we store just 1 */
int1store(p, (zend_uchar) stmt->flags);
p++;
/* Make it all zero */
int4store(p, 0);
int1store(p, 1); /* and send 1 for iteration count */
p+= 4;
ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length);
*free_buffer = (cmd_buffer != stmt->execute_cmd_buffer.buffer);
*request_len = (p - cmd_buffer);
*request = cmd_buffer;
DBG_INF_FMT("ret=%s", ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
}
示例9: ps_fetch_date
/* {{{ ps_fetch_date */
static void
ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t = {0};
zend_ulong length; /* First byte encodes the length*/
char * value;
DBG_ENTER("ps_fetch_date");
if ((length = php_mysqlnd_net_field_length(row))) {
zend_uchar *to= *row;
t.time_type= MYSQLND_TIMESTAMP_DATE;
t.neg= 0;
t.second_part = t.hour = t.minute = t.second = 0;
t.year = (unsigned int) sint2korr(to);
t.month = (unsigned int) to[2];
t.day = (unsigned int) to[3];
(*row)+= length;
} else {
memset(&t, 0, sizeof(t));
t.time_type = MYSQLND_TIMESTAMP_DATE;
}
length = mnd_sprintf(&value, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
DBG_INF_FMT("%s", value);
ZVAL_STRINGL(zv, value, length);
mnd_sprintf_free(value);
DBG_VOID_RETURN;
}
示例10: MYSQLND_METHOD
/* {{{ mysqlnd_vio::post_connect_set_opt */
static void
MYSQLND_METHOD(mysqlnd_vio, post_connect_set_opt)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme,
MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
php_stream * net_stream = vio->data->m.get_stream(vio);
DBG_ENTER("mysqlnd_vio::post_connect_set_opt");
if (net_stream) {
if (vio->data->options.timeout_read) {
struct timeval tv;
DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", vio->data->options.timeout_read);
tv.tv_sec = vio->data->options.timeout_read;
tv.tv_usec = 0;
php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
}
if (!memcmp(scheme.s, "tcp://", sizeof("tcp://") - 1)) {
/* TCP -> Set TCP_NODELAY */
mysqlnd_set_sock_no_delay(net_stream);
/* TCP -> Set SO_KEEPALIVE */
mysqlnd_set_sock_keepalive(net_stream);
}
}
DBG_VOID_RETURN;
}
示例11: MYSQLND_METHOD
/* {{{ mysqlnd_vio::has_valid_stream */
static zend_bool
MYSQLND_METHOD(mysqlnd_vio, has_valid_stream)(const MYSQLND_VIO * const vio)
{
DBG_ENTER("mysqlnd_vio::has_valid_stream");
DBG_INF_FMT("%p %p", vio, vio? vio->data->stream:NULL);
DBG_RETURN((vio && vio->data->stream)? TRUE: FALSE);
}
示例12: mysqlnd_local_infile_error
/* {{{ mysqlnd_local_infile_error */
static
int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_buf_len)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
DBG_ENTER("mysqlnd_local_infile_error");
if (info) {
strlcpy(error_buf, info->error_msg, error_buf_len);
DBG_INF_FMT("have info, %d", info->error_no);
DBG_RETURN(info->error_no);
}
strlcpy(error_buf, "Unknown error", error_buf_len);
DBG_INF_FMT("no info, %d", CR_UNKNOWN_ERROR);
DBG_RETURN(CR_UNKNOWN_ERROR);
}
示例13: MYSQLND_METHOD
/* {{{ mysqlnd_net::decode */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len,
const zend_uchar * const compressed_data, const size_t compressed_data_len)
{
#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
uLongf tmp_complen = uncompressed_data_len;
DBG_ENTER("mysqlnd_net::decode");
error = uncompress(uncompressed_data, &tmp_complen, compressed_data, compressed_data_len);
DBG_INF_FMT("compressed data: decomp_len=%lu compressed_size="MYSQLND_SZ_T_SPEC, tmp_complen, compressed_data_len);
if (error != Z_OK) {
DBG_INF_FMT("decompression NOT successful. error=%d Z_OK=%d Z_BUF_ERROR=%d Z_MEM_ERROR=%d", error, Z_OK, Z_BUF_ERROR, Z_MEM_ERROR);
}
DBG_RETURN(error == Z_OK? PASS:FAIL);
#else
DBG_ENTER("mysqlnd_net::decode");
DBG_RETURN(FAIL);
#endif
}
示例14: ps_fetch_double
/* {{{ ps_fetch_double */
static void
ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
double value;
DBG_ENTER("ps_fetch_double");
float8get(value, *row);
ZVAL_DOUBLE(zv, value);
(*row)+= 8;
DBG_INF_FMT("value=%f", value);
DBG_VOID_RETURN;
}
示例15: mysqlnd_sha256_auth_get_auth_data
/* {{{ mysqlnd_sha256_auth_get_auth_data */
static zend_uchar *
mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self,
size_t * auth_data_len,
MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd,
const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
)
{
RSA * server_public_key;
zend_uchar * ret = NULL;
DBG_ENTER("mysqlnd_sha256_auth_get_auth_data");
DBG_INF_FMT("salt(%d)=[%.*s]", auth_plugin_data_len, auth_plugin_data_len, auth_plugin_data);
if (conn->net->data->ssl) {
DBG_INF("simple clear text under SSL");
/* clear text under SSL */
*auth_data_len = passwd_len;
ret = malloc(passwd_len);
memcpy(ret, passwd, passwd_len);
} else {
*auth_data_len = 0;
server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options);
if (server_public_key) {
int server_public_key_len;
char xor_str[passwd_len + 1];
memcpy(xor_str, passwd, passwd_len);
xor_str[passwd_len] = '\0';
mysqlnd_xor_string(xor_str, passwd_len, (char *) auth_plugin_data, auth_plugin_data_len);
server_public_key_len = RSA_size(server_public_key);
/*
Because RSA_PKCS1_OAEP_PADDING is used there is a restriction on the passwd_len.
RSA_PKCS1_OAEP_PADDING is recommended for new applications. See more here:
http://www.openssl.org/docs/crypto/RSA_public_encrypt.html
*/
if ((size_t) server_public_key_len - 41 <= passwd_len) {
/* password message is to long */
SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "password is too long");
DBG_ERR("password is too long");
DBG_RETURN(NULL);
}
*auth_data_len = server_public_key_len;
ret = malloc(*auth_data_len);
RSA_public_encrypt(passwd_len + 1, (zend_uchar *) xor_str, ret, server_public_key, RSA_PKCS1_OAEP_PADDING);
}
}
DBG_RETURN(ret);
}