本文整理汇总了C++中purple_debug_is_verbose函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_debug_is_verbose函数的具体用法?C++ purple_debug_is_verbose怎么用?C++ purple_debug_is_verbose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purple_debug_is_verbose函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:60,代码来源:bosh.c
示例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);
}
开发者ID:ArmoredPidgin,项目名称:pidgin-hardened,代码行数:32,代码来源:libgaduw.c
示例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);
}
开发者ID:Distrotech,项目名称:pidgin,代码行数:35,代码来源:slp.c
示例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);
}
开发者ID:ArmoredPidgin,项目名称:pidgin-hardened,代码行数:34,代码来源:libgaduw.c
示例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);
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:32,代码来源:slplink.c
示例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);
}
开发者ID:crodjer,项目名称:pidgin_whiteboard,代码行数:32,代码来源:ft.c
示例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);
}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:25,代码来源:util.c
示例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);
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:34,代码来源:bosh.c
示例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;
}
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:35,代码来源:directconn.c
示例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);
}
开发者ID:Distrotech,项目名称:pidgin,代码行数:35,代码来源:slp.c
示例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;
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:27,代码来源:switchboard.c
示例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);
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:33,代码来源:slplink.c
示例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);
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:25,代码来源:slplink.c
示例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;
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:34,代码来源:directconn.c
示例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);
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:59,代码来源:switchboard.c
示例16: ggp_avatar_buddy_remove
void ggp_avatar_buddy_remove(PurpleConnection *gc, uin_t uin)
{
if (purple_debug_is_verbose()) {
purple_debug_misc("gg", "ggp_avatar_buddy_remove(%p, %u)\n", gc, uin);
}
purple_buddy_icons_set_for_user(purple_connection_get_account(gc),
ggp_uin_to_str(uin), NULL, 0, NULL);
}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:9,代码来源:avatar.c
示例17: jabber_bosh_connection_send_now
static void
jabber_bosh_connection_send_now(PurpleJabberBOSHConnection *conn)
{
PurpleHttpRequest *req;
GString *data;
g_return_if_fail(conn != NULL);
if (conn->send_timer != 0) {
purple_timeout_remove(conn->send_timer);
conn->send_timer = 0;
}
if (conn->sid == NULL)
return;
data = g_string_new(NULL);
/* missing parameters: route, from, ack */
g_string_printf(data, "<body "
"rid='%" G_GUINT64_FORMAT "' "
"sid='%s' "
"xmlns='" NS_BOSH "' "
"xmlns:xmpp='" NS_XMPP_BOSH "' ",
++conn->rid, conn->sid);
if (conn->js->reinit && !conn->is_terminating) {
g_string_append(data, "xmpp:restart='true'/>");
conn->js->reinit = FALSE;
} else {
if (conn->is_terminating)
g_string_append(data, "type='terminate' ");
g_string_append_c(data, '>');
g_string_append_len(data, conn->send_buff->str,
conn->send_buff->len);
g_string_append(data, "</body>");
g_string_set_size(conn->send_buff, 0);
}
if (purple_debug_is_verbose() && purple_debug_is_unsafe())
purple_debug_misc("jabber-bosh", "sending: %s\n", data->str);
req = jabber_bosh_connection_http_request_new(conn, data);
g_string_free(data, TRUE);
if (conn->is_terminating) {
purple_http_request(NULL, req, NULL, NULL);
g_free(conn->sid);
conn->sid = NULL;
} else {
purple_http_connection_set_add(conn->payload_reqs,
purple_http_request(conn->js->gc, req,
jabber_bosh_connection_recv, conn));
}
purple_http_request_unref(req);
}
开发者ID:ArmoredPidgin,项目名称:pidgin-hardened,代码行数:57,代码来源:bosh.c
示例18: find_available_http_connection
static PurpleHTTPConnection *
find_available_http_connection(PurpleBOSHConnection *conn)
{
int i;
if (purple_debug_is_verbose())
debug_dump_http_connections(conn);
/* Easy solution: Does everyone involved support pipelining? Hooray! Just use
* one TCP connection! */
if (conn->pipelining)
return conn->connections[0]->state == HTTP_CONN_CONNECTED ?
conn->connections[0] : NULL;
/* First loop, look for a connection that's ready */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
conn->connections[i]->state == HTTP_CONN_CONNECTED &&
conn->connections[i]->requests == 0)
return conn->connections[i];
}
/* Second loop, is something currently connecting? If so, just queue up. */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
conn->connections[i]->state == HTTP_CONN_CONNECTING)
return NULL;
}
/* Third loop, is something offline that we can connect? */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
conn->connections[i]->state == HTTP_CONN_OFFLINE) {
purple_debug_info("jabber", "bosh: Reconnecting httpconn "
"(%i, %p)\n", i, conn->connections[i]);
http_connection_connect(conn->connections[i]);
return NULL;
}
}
/* Fourth loop, look for one that's NULL and create a new connection */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (!conn->connections[i]) {
conn->connections[i] = jabber_bosh_http_connection_init(conn);
purple_debug_info("jabber", "bosh: Creating and connecting new httpconn "
"(%i, %p)\n", i, conn->connections[i]);
http_connection_connect(conn->connections[i]);
return NULL;
}
}
purple_debug_warning("jabber", "Could not find a HTTP connection!\n");
/* None available. */
return NULL;
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:57,代码来源:bosh.c
示例19: purple_xfer_ref
void
purple_xfer_ref(PurpleXfer *xfer)
{
g_return_if_fail(xfer != NULL);
xfer->ref++;
if (purple_debug_is_verbose())
purple_debug_info("xfer", "ref'd %p [%d]\n", xfer, xfer->ref);
}
开发者ID:crodjer,项目名称:pidgin_whiteboard,代码行数:10,代码来源:ft.c
示例20: find_available_http_connection
static PurpleHTTPConnection *
find_available_http_connection(PurpleBOSHConnection *conn)
{
int i;
if (purple_debug_is_verbose()) {
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
PurpleHTTPConnection *httpconn = conn->connections[i];
if (httpconn == NULL)
purple_debug_misc("jabber", "BOSH %p->connections[%d] = (nil)\n",
conn, i);
else
purple_debug_misc("jabber", "BOSH %p->connections[%d] = %p, state = %d"
", requests = %d\n", conn, i, httpconn,
httpconn->state, httpconn->requests);
}
}
/* Easy solution: Does everyone involved support pipelining? Hooray! Just use
* one TCP connection! */
if (conn->pipelining)
return conn->connections[0]->state == HTTP_CONN_CONNECTED ?
conn->connections[0] : NULL;
/* First loop, look for a connection that's ready */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
conn->connections[i]->state == HTTP_CONN_CONNECTED &&
conn->connections[i]->requests == 0)
return conn->connections[i];
}
/* Second loop, is something currently connecting? If so, just queue up. */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (conn->connections[i] &&
conn->connections[i]->state == HTTP_CONN_CONNECTING)
return NULL;
}
/* Third loop, look for one that's NULL and create a new connection */
for (i = 0; i < NUM_HTTP_CONNECTIONS; ++i) {
if (!conn->connections[i]) {
purple_debug_info("jabber", "bosh: Creating and connecting new httpconn\n");
conn->connections[i] = jabber_bosh_http_connection_init(conn);
http_connection_connect(conn->connections[i]);
return NULL;
}
}
purple_debug_warning("jabber", "Could not find a HTTP connection!\n");
/* None available. */
return NULL;
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:55,代码来源:bosh.c
注:本文中的purple_debug_is_verbose函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论