本文整理汇总了C++中purple_debug_is_verbose函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_debug_is_verbose函数的具体用法?C++ purple_debug_is_verbose怎么用?C++ purple_debug_is_verbose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purple_debug_is_verbose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: http_connection_send_request
static void
http_connection_send_request(PurpleHTTPConnection *conn, const GString *req)
{
char *data;
int ret;
size_t len;
/* Sending something to the server, restart the inactivity timer */
jabber_stream_restart_inactivity_timer(conn->bosh->js);
data = g_strdup_printf("POST %s HTTP/1.1\r\n"
"Host: %s\r\n"
"User-Agent: %s\r\n"
"Content-Encoding: text/xml; charset=utf-8\r\n"
"Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n"
"%s",
conn->bosh->path, conn->bosh->host, bosh_useragent,
req->len, req->str);
len = strlen(data);
++conn->requests;
++conn->bosh->requests;
if (purple_debug_is_unsafe() && purple_debug_is_verbose())
/* Will contain passwords for SASL PLAIN and is verbose */
purple_debug_misc("jabber", "BOSH (%p): Sending %s\n", conn, data);
else if (purple_debug_is_verbose())
purple_debug_misc("jabber", "BOSH (%p): Sending request of "
"%" G_GSIZE_FORMAT " bytes.\n", conn, len);
if (conn->writeh == 0)
ret = http_connection_do_send(conn, data, len);
else {
ret = -1;
errno = EAGAIN;
}
if (ret < 0 && errno != EAGAIN) {
/*
* TODO: Handle this better. Probably requires a PurpleBOSHConnection
* buffer that stores what is "being sent" until the
* PurpleHTTPConnection reports it is fully sent.
*/
gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
purple_connection_error_reason(conn->bosh->js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
tmp);
g_free(tmp);
return;
} else if (ret < len) {
if (ret < 0)
ret = 0;
if (conn->writeh == 0)
conn->writeh = purple_input_add(conn->psc ? conn->psc->fd : conn->fd,
PURPLE_INPUT_WRITE, http_connection_send_cb, conn);
purple_circ_buffer_append(conn->write_buf, data + ret, len - ret);
}
}
示例2: ggp_libgaduw_debug_handler
static void ggp_libgaduw_debug_handler(int level, const char * format,
va_list args)
{
PurpleDebugLevel purple_level;
char *msg;
if ((level & GG_DEBUG_NET) || (level & GG_DEBUG_FUNCTION) ||
(level & GG_DEBUG_VERBOSE))
{
if (!purple_debug_is_verbose())
return;
}
if ((level & GG_DEBUG_DUMP) || /* GG session protocol packets */
(level & GG_DEBUG_TRAFFIC)) /* HTTP traffic */
{
if (!purple_debug_is_verbose() || !purple_debug_is_unsafe())
return;
}
msg = g_strdup_vprintf(format, args);
if (level & GG_DEBUG_ERROR)
purple_level = PURPLE_DEBUG_ERROR;
else if (level & GG_DEBUG_WARNING)
purple_level = PURPLE_DEBUG_WARNING;
else
purple_level = PURPLE_DEBUG_MISC;
purple_debug(purple_level, "gg", "%s", msg);
g_free(msg);
}
示例3: request_own_user_display
static void
request_own_user_display(MsnUser *user)
{
PurpleAccount *account;
MsnSession *session;
MsnObject *my_obj = NULL;
gconstpointer data = NULL;
const char *info = NULL;
size_t len = 0;
if (purple_debug_is_verbose())
purple_debug_info("msn", "Requesting our own user display\n");
session = user->userlist->session;
account = session->account;
my_obj = msn_user_get_object(user);
if (my_obj != NULL) {
PurpleStoredImage *img = msn_object_get_image(my_obj);
data = purple_imgstore_get_data(img);
len = purple_imgstore_get_size(img);
info = msn_object_get_sha1(my_obj);
}
purple_buddy_icons_set_for_user(account, user->passport, g_memdup(data, len), len, info);
/* Free one window slot */
session->userlist->buddy_icon_window++;
if (purple_debug_is_verbose())
purple_debug_info("msn", "msn_request_user_display(): buddy_icon_window++ yields =%d\n",
session->userlist->buddy_icon_window);
msn_release_buddy_icon_request(session->userlist);
}
示例4: ggp_libgaduw_http_handler
static void ggp_libgaduw_http_handler(gpointer _req, gint fd,
PurpleInputCondition cond)
{
ggp_libgaduw_http_req *req = _req;
if (req->h->callback(req->h) == -1 || req->h->state == GG_STATE_ERROR) {
purple_debug_error("gg", "ggp_libgaduw_http_handler: failed to "
"make http request: %d\n", req->h->error);
ggp_libgaduw_http_finish(req, FALSE);
return;
}
if (purple_debug_is_verbose()) {
purple_debug_misc("gg", "ggp_libgaduw_http_handler: got fd "
"update [check=%d, state=%d]\n", req->h->check,
req->h->state);
}
if (req->h->state != GG_STATE_DONE) {
purple_input_remove(req->inpa);
req->inpa = ggp_purplew_http_input_add(req->h,
ggp_libgaduw_http_handler, req);
return;
}
if (!req->h->data || !req->h->body) {
purple_debug_error("gg", "ggp_libgaduw_http_handler: got empty "
"http response: %d\n", req->h->error);
ggp_libgaduw_http_finish(req, FALSE);
return;
}
ggp_libgaduw_http_finish(req, TRUE);
}
示例5: msn_slplink_destroy
void
msn_slplink_destroy(MsnSlpLink *slplink)
{
MsnSession *session;
if (purple_debug_is_verbose())
purple_debug_info("msn", "slplink_destroy: slplink(%p)\n", slplink);
g_return_if_fail(slplink != NULL);
if (slplink->swboard != NULL)
slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink);
session = slplink->session;
#if 0
if (slplink->directconn != NULL)
msn_directconn_destroy(slplink->directconn);
#endif
while (slplink->slp_calls != NULL)
msn_slpcall_destroy(slplink->slp_calls->data);
g_queue_free(slplink->slp_msg_queue);
session->slplinks =
g_list_remove(session->slplinks, slplink);
g_free(slplink->remote_user);
g_free(slplink);
}
示例6: purple_xfer_destroy
static void
purple_xfer_destroy(PurpleXfer *xfer)
{
PurpleXferUiOps *ui_ops;
g_return_if_fail(xfer != NULL);
if (purple_debug_is_verbose())
purple_debug_info("xfer", "destroyed %p [%d]\n", xfer, xfer->ref);
/* Close the file browser, if it's open */
purple_request_close_with_handle(xfer);
if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_STARTED)
purple_xfer_cancel_local(xfer);
ui_ops = purple_xfer_get_ui_ops(xfer);
if (ui_ops != NULL && ui_ops->destroy != NULL)
ui_ops->destroy(xfer);
g_free(xfer->who);
g_free(xfer->filename);
g_free(xfer->remote_ip);
g_free(xfer->local_filename);
g_hash_table_remove(xfers_data, xfer);
PURPLE_DBUS_UNREGISTER_POINTER(xfer);
xfers = g_list_remove(xfers, xfer);
g_free(xfer);
}
示例7: fb_util_vdebug
void
fb_util_vdebug(PurpleDebugLevel level, const gchar *format, va_list ap)
{
gboolean unsafe;
gboolean verbose;
gchar *str;
g_return_if_fail(format != NULL);
unsafe = (level & FB_UTIL_DEBUG_FLAG_UNSAFE) != 0;
verbose = (level & FB_UTIL_DEBUG_FLAG_VERBOSE) != 0;
if ((unsafe && !purple_debug_is_unsafe()) ||
(verbose && !purple_debug_is_verbose()))
{
return;
}
/* Ensure all local flags are removed */
level &= ~FB_UTIL_DEBUG_FLAG_ALL;
str = g_strdup_vprintf(format, ap);
purple_debug(level, "facebook", "%s\n", str);
g_free(str);
}
示例8: connection_common_established_cb
static void
connection_common_established_cb(PurpleHTTPConnection *conn)
{
purple_debug_misc("jabber", "bosh: httpconn %p re-connected\n", conn);
/* Indicate we're ready and reset some variables */
conn->state = HTTP_CONN_CONNECTED;
if (conn->requests != 0)
purple_debug_error("jabber", "bosh: httpconn %p has %d requests, != 0\n",
conn, conn->requests);
conn->requests = 0;
if (conn->read_buf) {
g_string_free(conn->read_buf, TRUE);
conn->read_buf = NULL;
}
conn->close = FALSE;
conn->headers_done = FALSE;
conn->handled_len = conn->body_len = 0;
if (purple_debug_is_verbose())
debug_dump_http_connections(conn->bosh);
if (conn->bosh->js->reinit)
jabber_bosh_connection_send(conn->bosh, PACKET_NORMAL, NULL);
else if (conn->bosh->state == BOSH_CONN_ONLINE) {
purple_debug_info("jabber", "BOSH session already exists. Trying to reuse it.\n");
if (conn->bosh->requests == 0 || conn->bosh->pending->bufused > 0) {
/* Send the pending data */
jabber_bosh_connection_send(conn->bosh, PACKET_FLUSH, NULL);
}
} else
jabber_bosh_connection_boot(conn->bosh);
}
示例9: msn_dc_incoming_connection_cb
/*
* This callback will be called when we're the server
* and somebody has connected to us in DC_INCOMING_TIMEOUT seconds.
*/
static void
msn_dc_incoming_connection_cb(gpointer data, gint listenfd, PurpleInputCondition cond)
{
MsnDirectConn *dc = data;
if (purple_debug_is_verbose())
purple_debug_info("msn", "msn_dc_incoming_connection_cb %p\n", dc);
g_return_if_fail(dc != NULL);
if (dc->connect_timeout_handle != 0) {
purple_timeout_remove(dc->connect_timeout_handle);
dc->connect_timeout_handle = 0;
}
if (dc->listenfd_handle != 0) {
purple_input_remove(dc->listenfd_handle);
dc->listenfd_handle = 0;
}
dc->fd = accept(listenfd, NULL, 0);
purple_network_remove_port_mapping(dc->listenfd);
close(dc->listenfd);
dc->listenfd = -1;
if (dc->fd != -1) {
msn_dc_init(dc);
dc->state = DC_STATE_FOO;
}
}
示例10: end_user_display
static void
end_user_display(MsnSlpCall *slpcall, MsnSession *session)
{
MsnUserList *userlist;
g_return_if_fail(session != NULL);
if (purple_debug_is_verbose())
purple_debug_info("msn", "End User Display\n");
userlist = session->userlist;
/* If the session is being destroyed we better stop doing anything. */
if (session->destroying)
return;
/* Delay before freeing a buddy icon window slot and requesting the next icon, if appropriate.
* If we don't delay, we'll rapidly hit the MSN equivalent of AIM's rate limiting; the server will
* send us an error 800 like so:
*
* C: NS 000: XFR 21 SB
* S: NS 000: 800 21
*/
if (userlist->buddy_icon_request_timer) {
/* Free the window slot used by this previous request */
userlist->buddy_icon_window++;
/* Clear our pending timeout */
purple_timeout_remove(userlist->buddy_icon_request_timer);
}
/* Wait BUDDY_ICON_DELAY s before freeing our window slot and requesting the next icon. */
userlist->buddy_icon_request_timer = purple_timeout_add_seconds(BUDDY_ICON_DELAY,
msn_release_buddy_icon_request_timeout, userlist);
}
示例11: msn_switchboard_new
MsnSwitchBoard *
msn_switchboard_new(MsnSession *session)
{
MsnSwitchBoard *swboard;
g_return_val_if_fail(session != NULL, NULL);
swboard = g_new0(MsnSwitchBoard, 1);
swboard->session = session;
swboard->servconn = msn_servconn_new(session, MSN_SERVCONN_SB);
msn_servconn_set_idle_timeout(swboard->servconn, 60);
swboard->cmdproc = swboard->servconn->cmdproc;
swboard->msg_queue = g_queue_new();
swboard->empty = TRUE;
swboard->cmdproc->data = swboard;
swboard->cmdproc->cbs_table = cbs_table;
session->switches = g_list_prepend(session->switches, swboard);
if (purple_debug_is_verbose())
purple_debug_info("msn", "switchboard new: swboard(%p)\n", swboard);
return swboard;
}
示例12: msn_slplink_destroy
static void
msn_slplink_destroy(MsnSlpLink *slplink)
{
MsnSession *session;
if (purple_debug_is_verbose())
purple_debug_info("msn", "slplink_destroy: slplink(%p)\n", slplink);
if (slplink->swboard != NULL) {
slplink->swboard->slplinks = g_list_remove(slplink->swboard->slplinks, slplink);
slplink->swboard = NULL;
}
session = slplink->session;
if (slplink->dc != NULL) {
slplink->dc->slplink = NULL;
msn_dc_destroy(slplink->dc);
slplink->dc = NULL;
}
while (slplink->slp_calls != NULL)
msn_slpcall_destroy(slplink->slp_calls->data);
g_queue_free(slplink->slp_msg_queue);
session->slplinks =
g_list_remove(session->slplinks, slplink);
g_free(slplink->remote_user);
g_free(slplink);
}
示例13: msn_slplink_new
static MsnSlpLink *
msn_slplink_new(MsnSession *session, const char *username)
{
MsnSlpLink *slplink;
g_return_val_if_fail(session != NULL, NULL);
slplink = g_new0(MsnSlpLink, 1);
if (purple_debug_is_verbose())
purple_debug_info("msn", "slplink_new: slplink(%p)\n", slplink);
slplink->session = session;
slplink->slp_seq_id = rand() % 0xFFFFFF00 + 4;
slplink->remote_user = g_strdup(username);
slplink->p2p_version = MSN_P2P_VERSION_ONE;
slplink->slp_msg_queue = g_queue_new();
session->slplinks =
g_list_append(session->slplinks, slplink);
return msn_slplink_ref(slplink);
}
示例14: msn_dc_incoming_connection_timeout_cb
/*
* This callback will be called when we're the server
* and nobody has connected us in DC_INCOMING_TIMEOUT seconds
*/
static gboolean
msn_dc_incoming_connection_timeout_cb(gpointer data) {
MsnDirectConn *dc = data;
if (purple_debug_is_verbose())
purple_debug_info("msn", "msn_dc_incoming_connection_timeout_cb %p\n", dc);
g_return_val_if_fail(dc != NULL, FALSE);
if (dc->listen_data != NULL) {
purple_network_listen_cancel(dc->listen_data);
dc->listen_data = NULL;
}
if (dc->listenfd_handle != 0) {
purple_input_remove(dc->listenfd_handle);
dc->listenfd_handle = 0;
}
if (dc->listenfd != -1) {
purple_network_remove_port_mapping(dc->listenfd);
close(dc->listenfd);
dc->listenfd = -1;
}
dc->connect_timeout_handle = 0;
msn_dc_fallback_to_sb(dc);
return FALSE;
}
示例15: release_msg
static void
release_msg(MsnSwitchBoard *swboard, MsnMessage *msg)
{
MsnCmdProc *cmdproc;
MsnTransaction *trans;
char *payload;
gsize payload_len;
char flag;
g_return_if_fail(swboard != NULL);
g_return_if_fail(msg != NULL);
cmdproc = swboard->cmdproc;
payload = msn_message_gen_payload(msg, &payload_len);
if (purple_debug_is_verbose()) {
purple_debug_info("msn", "SB length:{%" G_GSIZE_FORMAT "}\n", payload_len);
msn_message_show_readable(msg, "SB SEND", FALSE);
}
flag = msn_message_get_flag(msg);
trans = msn_transaction_new(cmdproc, "MSG", "%c %" G_GSIZE_FORMAT,
flag, payload_len);
/* Data for callbacks */
msn_transaction_set_data(trans, msg);
if (flag != 'U') {
if (msg->type == MSN_MSG_TEXT)
{
msg->ack_ref = TRUE;
msn_message_ref(msg);
swboard->ack_list = g_list_append(swboard->ack_list, msg);
msn_transaction_set_timeout_cb(trans, msg_timeout);
}
else if (msg->type == MSN_MSG_SLP)
{
msg->ack_ref = TRUE;
msn_message_ref(msg);
swboard->ack_list = g_list_append(swboard->ack_list, msg);
msn_transaction_set_timeout_cb(trans, msg_timeout);
#if 0
if (msg->ack_cb != NULL)
{
msn_transaction_add_cb(trans, "ACK", msg_ack);
msn_transaction_add_cb(trans, "NAK", msg_nak);
}
#endif
}
}
trans->payload = payload;
trans->payload_len = payload_len;
msg->trans = trans;
msn_cmdproc_send_trans(cmdproc, trans);
}