当前位置: 首页>>代码示例>>C++>>正文


C++ DBG_RETURN函数代码示例

本文整理汇总了C++中DBG_RETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ DBG_RETURN函数的具体用法?C++ DBG_RETURN怎么用?C++ DBG_RETURN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DBG_RETURN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mysqlnd_set_sock_keepalive

/* {{{ mysqlnd_set_sock_keepalive */
static int
mysqlnd_set_sock_keepalive(php_stream * stream)
{

	int socketd = ((php_netstream_data_t*)stream->abstract)->socket;
	int ret = SUCCESS;
	int flag = 1;
	int result = setsockopt(socketd, SOL_SOCKET, SO_KEEPALIVE, (char *) &flag, sizeof(int));

	DBG_ENTER("mysqlnd_set_sock_keepalive");

	if (result == -1) {
		ret = FAILURE;
	}

	DBG_RETURN(ret);
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:18,代码来源:mysqlnd_net.c

示例2: mysqlnd_com_handshake_run_command

/* {{{ mysqlnd_com_handshake_run_command */
static enum_func_status
mysqlnd_com_handshake_run_command(va_list args)
{
	struct st_mysqlnd_protocol_com_handshake_command command;
	enum_func_status ret;

	DBG_ENTER("mysqlnd_com_handshake_run_command");
	command.context.conn = va_arg(args, MYSQLND_CONN_DATA *);
	command.context.user = *va_arg(args, const MYSQLND_CSTRING *);
	command.context.passwd = *va_arg(args, const MYSQLND_CSTRING *);
	command.context.database = *va_arg(args, const MYSQLND_CSTRING *);
	command.context.client_flags = va_arg(args, size_t);

	ret = mysqlnd_com_handshake_run(&command);

	DBG_RETURN(ret);
}
开发者ID:AllenJB,项目名称:php-src,代码行数:18,代码来源:mysqlnd_commands.c

示例3: mysqlnd_set_sock_no_delay

/* {{{ mysqlnd_set_sock_no_delay */
static int
mysqlnd_set_sock_no_delay(php_stream * stream)
{

	int socketd = ((php_netstream_data_t*)stream->abstract)->socket;
	int ret = SUCCESS;
	int flag = 1;
	int result = setsockopt(socketd, IPPROTO_TCP,  TCP_NODELAY, (char *) &flag, sizeof(int));

	DBG_ENTER("mysqlnd_set_sock_no_delay");

	if (result == -1) {
		ret = FAILURE;
	}

	DBG_RETURN(ret);
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:18,代码来源:mysqlnd_net.c

示例4: mysqlnd_com_change_user_create_command

/* {{{ mysqlnd_com_change_user_create_command */
static struct st_mysqlnd_protocol_command *
mysqlnd_com_change_user_create_command(va_list args)
{
	struct st_mysqlnd_protocol_com_change_user_command * command;
	DBG_ENTER("mysqlnd_com_change_user_create_command");
	command = mnd_ecalloc(1, sizeof(struct st_mysqlnd_protocol_com_change_user_command));
	if (command) {
		command->context.conn = va_arg(args, MYSQLND_CONN_DATA *);
		command->context.payload = va_arg(args, MYSQLND_CSTRING);
		command->context.silent = va_arg(args, unsigned int);

		command->parent.free_command = mysqlnd_com_no_params_free_command;
		command->parent.run = mysqlnd_com_change_user_run;
	}

	DBG_RETURN((struct st_mysqlnd_protocol_command *) command);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:18,代码来源:mysqlnd_commands.c

示例5: MYSQLND_METHOD

/* {{{ mysqlnd_net::init */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
	unsigned int buf_size;
	DBG_ENTER("mysqlnd_net::init");

	buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
	net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size);

	buf_size = MYSQLND_G(net_read_buffer_size); /* this is long, cast to unsigned int*/
	net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size);

	buf_size = MYSQLND_G(net_read_timeout); /* this is long, cast to unsigned int*/
	net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size);

	DBG_RETURN(PASS);
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:18,代码来源:mysqlnd_net.c

示例6: mysqlnd_com_process_kill_create_command

/* {{{ mysqlnd_com_process_kill_create_command */
static struct st_mysqlnd_protocol_command *
mysqlnd_com_process_kill_create_command(va_list args)
{
	struct st_mysqlnd_protocol_com_process_kill_command * command;
	DBG_ENTER("mysqlnd_com_process_kill_create_command");
	command = mnd_ecalloc(1, sizeof(struct st_mysqlnd_protocol_com_process_kill_command));
	if (command) {
		command->context.conn = va_arg(args, MYSQLND_CONN_DATA *);
		command->context.process_id = va_arg(args, unsigned int);
		command->context.read_response = va_arg(args, unsigned int)? TRUE:FALSE;

		command->parent.free_command = mysqlnd_com_no_params_free_command;
		command->parent.run = mysqlnd_com_process_kill_run;
	}

	DBG_RETURN((struct st_mysqlnd_protocol_command *) command);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:18,代码来源:mysqlnd_commands.c

示例7: MYSQLND_METHOD

/* {{{ mysqlnd_vio::consume_uneaten_data */
size_t
MYSQLND_METHOD(mysqlnd_vio, consume_uneaten_data)(MYSQLND_VIO * const net, enum php_mysqlnd_server_command cmd)
{
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
	/*
	  Switch to non-blocking mode and try to consume something from
	  the line, if possible, then continue. This saves us from looking for
	  the actual place where out-of-order packets have been sent.
	  If someone is completely sure that everything is fine, he can switch it
	  off.
	*/
	char tmp_buf[256];
	size_t skipped_bytes = 0;
	int opt = PHP_STREAM_OPTION_BLOCKING;
	php_stream * net_stream = net->data->get_stream(net);
	int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL);

	DBG_ENTER("mysqlnd_vio::consume_uneaten_data");

	if (PHP_STREAM_OPTION_RETURN_ERR != was_blocked) {
		/* Do a read of 1 byte */
		int bytes_consumed;

		do {
			skipped_bytes += (bytes_consumed = php_stream_read(net_stream, tmp_buf, sizeof(tmp_buf)));
		} while (bytes_consumed == sizeof(tmp_buf));

		if (was_blocked) {
			net_stream->ops->set_option(net_stream, opt, 1, NULL);
		}

		if (bytes_consumed) {
			DBG_ERR_FMT("Skipped %u bytes. Last command hasn't consumed all the output from the server",
						bytes_consumed, mysqlnd_command_to_text[net->last_command]);
			php_error_docref(NULL, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
							 "consumed all the output from the server",
							 bytes_consumed, mysqlnd_command_to_text[net->last_command]);
		}
	}
	net->last_command = cmd;

	DBG_RETURN(skipped_bytes);
#else
	return 0;
#endif
}
开发者ID:KonstantinKuklin,项目名称:php-src,代码行数:47,代码来源:mysqlnd_vio.c

示例8: mysqlnd_local_infile_read

/* {{{ mysqlnd_local_infile_read */
static
int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len)
{
	MYSQLND_INFILE_INFO	*info = (MYSQLND_INFILE_INFO *)ptr;
	int count;

	DBG_ENTER("mysqlnd_local_infile_read");

	count = (int) php_stream_read(info->fd, (char *) buf, buf_len);

	if (count < 0) {
		strcpy(info->error_msg, "Error reading file");
		info->error_no = CR_UNKNOWN_ERROR;
	}

	DBG_RETURN(count);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:18,代码来源:mysqlnd_loaddata.c

示例9: mysqlnd_com_enable_ssl_create_command

/* {{{ mysqlnd_com_enable_ssl_create_command */
static struct st_mysqlnd_protocol_command *
mysqlnd_com_enable_ssl_create_command(va_list args)
{
	struct st_mysqlnd_protocol_com_enable_ssl_command * command;
	DBG_ENTER("mysqlnd_com_enable_ssl_create_command");
	command = mnd_ecalloc(1, sizeof(struct st_mysqlnd_protocol_com_enable_ssl_command));
	if (command) {
		command->context.conn = va_arg(args, MYSQLND_CONN_DATA *);
		command->context.client_capabilities = va_arg(args, size_t);
		command->context.server_capabilities = va_arg(args, size_t);
		command->context.charset_no = va_arg(args, unsigned int);

		command->parent.free_command = mysqlnd_com_no_params_free_command;
		command->parent.run = mysqlnd_com_enable_ssl_run;
	}

	DBG_RETURN((struct st_mysqlnd_protocol_command *) command);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:19,代码来源:mysqlnd_commands.c

示例10: MYSQLND_METHOD

/* {{{ mysqlnd_command::stmt_fetch */
static enum_func_status
MYSQLND_METHOD(mysqlnd_command, stmt_fetch)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload)
{
	func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;
	enum_func_status ret = FAIL;

	DBG_ENTER("mysqlnd_command::stmt_fetch");

	ret = send_command(conn->payload_decoder_factory, COM_STMT_FETCH, (const zend_uchar*) payload.s, payload.l, FALSE,
					   &conn->state,
					   conn->error_info,
					   conn->upsert_status,
					   conn->stats,
					   conn->m->send_close,
					   conn);

	DBG_RETURN(ret);
}
开发者ID:IMSoP,项目名称:php-src,代码行数:19,代码来源:mysqlnd_commands.c

示例11: mysqlnd_com_init_db_run

/* {{{ mysqlnd_com_init_db_run */
static enum_func_status
mysqlnd_com_init_db_run(void *cmd)
{
	struct st_mysqlnd_protocol_com_init_db_command * command = (struct st_mysqlnd_protocol_com_init_db_command *) cmd;
	enum_func_status ret = FAIL;
	MYSQLND_CONN_DATA * conn = command->context.conn;
	const MYSQLND_CSTRING db = command->context.db;
	func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;
	func_mysqlnd_protocol_payload_decoder_factory__send_command_handle_response send_command_handle_response = conn->payload_decoder_factory->m.send_command_handle_response;

	DBG_ENTER("mysqlnd_com_init_db_run");

	ret = send_command(conn->payload_decoder_factory, COM_INIT_DB, (zend_uchar*) command->context.db.s, command->context.db.l, FALSE,
					   &conn->state,
					   conn->error_info,
					   conn->upsert_status,
					   conn->stats,
					   conn->m->send_close,
					   conn);
	if (PASS == ret) {
		ret = send_command_handle_response(conn->payload_decoder_factory, PROT_OK_PACKET, FALSE, COM_INIT_DB, TRUE,
										   conn->error_info, conn->upsert_status, &conn->last_message, conn->persistent);
	}

	/*
	  The server sends 0 but libmysql doesn't read it and has established
	  a protocol of giving back -1. Thus we have to follow it :(
	*/
	UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
	if (ret == PASS) {
		if (conn->connect_or_select_db.s) {
			mnd_pefree(conn->connect_or_select_db.s, conn->persistent);
		}
		conn->connect_or_select_db.s = mnd_pestrndup(db.s, db.l, conn->persistent);
		conn->connect_or_select_db.l = db.l;
		if (!conn->connect_or_select_db.s) {
			/* OOM */
			SET_OOM_ERROR(conn->error_info);
			ret = FAIL;
		}
	}

	DBG_RETURN(ret);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:45,代码来源:mysqlnd_commands.c

示例12: mysqlnd_mempool_create

/* {{{ mysqlnd_mempool_create */
PHPAPI MYSQLND_MEMORY_POOL *
mysqlnd_mempool_create(size_t arena_size)
{
	/* We calloc, because we free(). We don't mnd_calloc()  for a reason. */
	MYSQLND_MEMORY_POOL * ret = mnd_ecalloc(1, sizeof(MYSQLND_MEMORY_POOL));
	DBG_ENTER("mysqlnd_mempool_create");
	if (ret) {
		ret->get_chunk = mysqlnd_mempool_get_chunk;
		ret->free_size = ret->arena_size = arena_size ? arena_size : 0;
		ret->refcount = 0;
		/* OOM ? */
		ret->arena = mnd_emalloc(ret->arena_size);
		if (!ret->arena) {
			mysqlnd_mempool_destroy(ret);
			ret = NULL;
		}
	}
	DBG_RETURN(ret);
}
开发者ID:CooCoooo,项目名称:php-src,代码行数:20,代码来源:mysqlnd_block_alloc.c

示例13: mysqlnd_com_handshake_create_command

/* {{{ mysqlnd_com_handshake_create_command */
static struct st_mysqlnd_protocol_command *
mysqlnd_com_handshake_create_command(va_list args)
{
	struct st_mysqlnd_protocol_com_handshake_command * command;
	DBG_ENTER("mysqlnd_com_handshake_create_command");
	command = mnd_ecalloc(1, sizeof(struct st_mysqlnd_protocol_com_handshake_command));
	if (command) {
		command->context.conn = va_arg(args, MYSQLND_CONN_DATA *);
		command->context.user = *va_arg(args, const MYSQLND_CSTRING *);
		command->context.passwd = *va_arg(args, const MYSQLND_CSTRING *);
		command->context.database = *va_arg(args, const MYSQLND_CSTRING *);
		command->context.client_flags = va_arg(args, size_t);

		command->parent.free_command = mysqlnd_com_no_params_free_command;
		command->parent.run = mysqlnd_com_handshake_run;
	}

	DBG_RETURN((struct st_mysqlnd_protocol_command *) command);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:20,代码来源:mysqlnd_commands.c

示例14: mysqlnd_com_quit_run

/* {{{ mysqlnd_com_quit_run */
enum_func_status
mysqlnd_com_quit_run(void *cmd)
{
	struct st_mysqlnd_protocol_com_quit_command * command = (struct st_mysqlnd_protocol_com_quit_command *) cmd;
	enum_func_status ret = FAIL;
	MYSQLND_CONN_DATA * conn = command->context.conn;
	func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;

	DBG_ENTER("mysqlnd_com_quit_run");

	ret = send_command(conn->payload_decoder_factory, COM_QUIT, NULL, 0, TRUE,
					   &conn->state,
					   conn->error_info,
					   conn->upsert_status,
					   conn->stats,
					   conn->m->send_close,
					   conn);

	DBG_RETURN(ret);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:21,代码来源:mysqlnd_commands.c

示例15: mysqlnd_com_stmt_fetch_run

/* {{{ mysqlnd_com_stmt_fetch_run */
static enum_func_status
mysqlnd_com_stmt_fetch_run(void *cmd)
{
	struct st_mysqlnd_protocol_com_stmt_fetch_command * command = (struct st_mysqlnd_protocol_com_stmt_fetch_command *) cmd;
	enum_func_status ret = FAIL;
	MYSQLND_CONN_DATA * conn = command->context.conn;
	func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command;

	DBG_ENTER("mysqlnd_com_stmt_fetch_run");

	ret = send_command(conn->payload_decoder_factory, COM_STMT_FETCH, (zend_uchar*) command->context.payload.s, command->context.payload.l, FALSE,
					   &conn->state,
					   conn->error_info,
					   conn->upsert_status,
					   conn->stats,
					   conn->m->send_close,
					   conn);

	DBG_RETURN(ret);
}
开发者ID:Distrotech,项目名称:php-src,代码行数:21,代码来源:mysqlnd_commands.c


注:本文中的DBG_RETURN函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。