From: <fac...@us...> - 2006-08-22 18:28:20
|
Revision: 16984 Author: faceprint Date: 2006-08-22 11:28:00 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16984&view=rev Log Message: ----------- get rid of some hardcoding of jabber IQ callbacks this should let plugins add their own callbacks, I think Modified Paths: -------------- trunk/libgaim/protocols/jabber/disco.c trunk/libgaim/protocols/jabber/iq.c trunk/libgaim/protocols/jabber/iq.h trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/oob.c trunk/libgaim/protocols/jabber/si.c Modified: trunk/libgaim/protocols/jabber/disco.c =================================================================== --- trunk/libgaim/protocols/jabber/disco.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/disco.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -200,7 +200,7 @@ const char *from = xmlnode_get_attrib(packet, "from"); const char *type = xmlnode_get_attrib(packet, "type"); - if(!strcmp(type, "get")) { + if(type && !strcmp(type, "get")) { JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "http://jabber.org/protocol/disco#items"); Modified: trunk/libgaim/protocols/jabber/iq.c =================================================================== --- trunk/libgaim/protocols/jabber/iq.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/iq.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -34,6 +34,9 @@ #include "utsname.h" #endif +GHashTable *iq_handlers = NULL; + + JabberIq *jabber_iq_new(JabberStream *js, JabberIqType type) { JabberIq *iq; @@ -250,6 +253,7 @@ xmlnode *query, *error, *x; const char *xmlns; const char *type, *id, *from; + JabberIqHandler *jih; query = xmlnode_get_child(packet, "query"); type = xmlnode_get_attrib(packet, "type"); @@ -269,53 +273,18 @@ /* Apparently not, so lets see if we have a pre-defined handler */ if(type && query && (xmlns = xmlnode_get_namespace(query))) { - if(!strcmp(type, "set")) { - if(!strcmp(xmlns, "jabber:iq:roster")) { - jabber_roster_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:oob")) { - jabber_oob_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/bytestreams")) { - jabber_bytestreams_parse(js, packet); - return; - } - } else if(!strcmp(type, "get")) { - if(!strcmp(xmlns, "jabber:iq:last")) { - jabber_iq_last_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:time")) { - jabber_iq_time_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:version")) { - jabber_iq_version_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#info")) { - jabber_disco_info_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#items")) { - jabber_disco_items_parse(js, packet); - return; - } - } else if(!strcmp(type, "result")) { - if(!strcmp(xmlns, "jabber:iq:roster")) { - jabber_roster_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:register")) { - jabber_register_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#info")) { - jabber_disco_info_parse(js, packet); - return; - } - } - } else { - if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { - jabber_si_parse(js, packet); + if((jih = g_hash_table_lookup(iq_handlers, xmlns))) { + jih(js, packet); return; } } + + if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { + jabber_si_parse(js, packet); + return; + } + /* If we get here, send the default error reply mandated by XMPP-CORE */ if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) { JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); @@ -335,3 +304,28 @@ } } +void jabber_iq_register_handler(const char *xmlns, JabberIqHandler handlerfunc) +{ + g_hash_table_replace(iq_handlers, g_strdup(xmlns), handlerfunc); +} + +void jabber_iq_init(void) +{ + iq_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + + jabber_iq_register_handler("jabber:iq:roster", jabber_roster_parse); + jabber_iq_register_handler("jabber:iq:oob", jabber_oob_parse); + jabber_iq_register_handler("http://jabber.org/protocol/bytestreams", jabber_bytestreams_parse); + jabber_iq_register_handler("jabber:iq:last", jabber_iq_last_parse); + jabber_iq_register_handler("jabber:iq:time", jabber_iq_time_parse); + jabber_iq_register_handler("jabber:iq:version", jabber_iq_version_parse); + jabber_iq_register_handler("http://jabber.org/protocol/disco#info", jabber_disco_info_parse); + jabber_iq_register_handler("http://jabber.org/protocol/disco#items", jabber_disco_items_parse); + jabber_iq_register_handler("jabber:iq:register", jabber_register_parse); +} + +void jabber_iq_uninit(void) +{ + g_hash_table_destroy(iq_handlers); +} + Modified: trunk/libgaim/protocols/jabber/iq.h =================================================================== --- trunk/libgaim/protocols/jabber/iq.h 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/iq.h 2006-08-22 18:28:00 UTC (rev 16984) @@ -34,6 +34,8 @@ JABBER_IQ_NONE } JabberIqType; +typedef void (JabberIqHandler)(JabberStream *js, xmlnode *packet); + typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data); struct _JabberIq { @@ -60,4 +62,9 @@ void jabber_iq_send(JabberIq *iq); void jabber_iq_free(JabberIq *iq); +void jabber_iq_init(void); +void jabber_iq_uninit(void); + +void jabber_iq_register_handler(const char *xmlns, JabberIqHandler *func); + #endif /* _GAIM_JABBER_IQ_H_ */ Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -705,6 +705,10 @@ void jabber_register_parse(JabberStream *js, xmlnode *packet) { + const char *type; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "result")) + return; + if(js->registration) { GaimRequestFields *fields; GaimRequestFieldGroup *group; @@ -1957,6 +1961,8 @@ sasl_client_init(NULL); #endif jabber_register_commands(); + + jabber_iq_init(); } GAIM_INIT_PLUGIN(jabber, init_plugin, info); Modified: trunk/libgaim/protocols/jabber/oob.c =================================================================== --- trunk/libgaim/protocols/jabber/oob.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/oob.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -192,8 +192,12 @@ GaimXfer *xfer; char *filename; char *url; + const char *type; xmlnode *querynode, *urlnode; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "set")) + return; + if(!(querynode = xmlnode_get_child(packet, "query"))) return; Modified: trunk/libgaim/protocols/jabber/si.c =================================================================== --- trunk/libgaim/protocols/jabber/si.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/si.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -191,8 +191,11 @@ GaimXfer *xfer; JabberSIXfer *jsx; xmlnode *query, *streamhost; - const char *sid, *from; + const char *sid, *from, *type; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "set")) + return; + if(!(from = xmlnode_get_attrib(packet, "from"))) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-23 16:37:17
|
Revision: 17005 Author: faceprint Date: 2006-08-23 09:36:58 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17005&view=rev Log Message: ----------- a prpl's set_idle function can be called before the login function this is because the signing-on signal is emitted, and there's a callback to check idle and update all the prpls attached to that signal this meant that if you were idle, and got disconnected from jabber, upon attempting to reconnect, you'd segfault I've changed how jabber handles idle updates to work around this. someone may want to audit the other prpls, to make sure their set_idle callbacks (if any) don't assume the connection is up Modified Paths: -------------- trunk/libgaim/protocols/jabber/iq.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/jabber.h Modified: trunk/libgaim/protocols/jabber/iq.c =================================================================== --- trunk/libgaim/protocols/jabber/iq.c 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/iq.c 2006-08-23 16:36:58 UTC (rev 17005) @@ -145,7 +145,7 @@ const char *from; const char *id; xmlnode *query; - char *idle_time; + GaimPresence *gpresence; type = xmlnode_get_attrib(packet, "type"); from = xmlnode_get_attrib(packet, "from"); @@ -158,10 +158,19 @@ query = xmlnode_get_child(iq->node, "query"); - idle_time = g_strdup_printf("%ld", js->idle ? time(NULL) - js->idle : 0); - xmlnode_set_attrib(query, "seconds", idle_time); - g_free(idle_time); + gpresence = gaim_account_get_presence(js->gc->account); + if(gaim_presence_is_idle(gpresence)) { + time_t idle_time = gaim_presence_get_idle_time(gpresence); + char *idle_str; + + idle_str = g_strdup_printf("%ld", time(NULL) - idle_time); + xmlnode_set_attrib(query, "seconds", idle_str); + g_free(idle_str); + } else { + xmlnode_set_attrib(query, "seconds", "0"); + } + jabber_iq_send(iq); } } Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 16:36:58 UTC (rev 17005) @@ -1040,13 +1040,14 @@ return g_strdup_printf("gaim%x", js->next_id++); } - +/* static void jabber_idle_set(GaimConnection *gc, int idle) { JabberStream *js = gc->proto_data; js->idle = idle ? time(NULL) - idle : idle; } +*/ static const char *jabber_list_icon(GaimAccount *a, GaimBuddy *b) { @@ -1847,7 +1848,7 @@ jabber_send_typing, /* send_typing */ jabber_buddy_get_info, /* get_info */ jabber_presence_send, /* set_away */ - jabber_idle_set, /* set_idle */ + NULL, /* set_idle */ NULL, /* change_passwd */ jabber_roster_add_buddy, /* add_buddy */ NULL, /* add_buddies */ Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 16:36:58 UTC (rev 17005) @@ -111,8 +111,6 @@ GList *oob_file_transfers; GList *file_transfers; - time_t idle; - JabberID *user; GaimConnection *gc; GaimSslConnection *gsc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-09-06 03:59:01
|
Revision: 17177 http://svn.sourceforge.net/gaim/?rev=17177&view=rev Author: faceprint Date: 2006-09-05 20:58:53 -0700 (Tue, 05 Sep 2006) Log Message: ----------- commit part of 1547648 commit some jabber stuff I did a few days ago and forgot about Modified Paths: -------------- trunk/libgaim/protocols/jabber/buddy.c trunk/libgaim/protocols/jabber/chat.c trunk/libgaim/protocols/jabber/presence.c trunk/libgaim/protocols/jabber/presence.h Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2006-09-06 03:12:05 UTC (rev 17176) +++ trunk/libgaim/protocols/jabber/buddy.c 2006-09-06 03:58:53 UTC (rev 17177) @@ -658,6 +658,8 @@ purdy = gaim_strdup_withhtml(jbr->status); g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", _("Resource"), jbr->name); + g_string_append_printf(info_text, "<b>%s:</b> %d<br/>", + _("Priority"), jbr->priority); g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>", _("Status"), jabber_buddy_state_get_name(jbr->state), purdy ? ": " : "", @@ -1190,7 +1192,7 @@ JabberBuddy *jb = jabber_buddy_find(js, who, TRUE); xmlnode *presence; JabberBuddyState state; - const char *msg; + char *msg; int priority; account = gaim_connection_get_account(js->gc); @@ -1200,6 +1202,8 @@ gaim_status_to_jabber(status, &state, &msg, &priority); presence = jabber_presence_create(state, msg, priority); + g_free(msg); + xmlnode_set_attrib(presence, "to", who); if(invisible) { xmlnode_set_attrib(presence, "type", "invisible"); Modified: trunk/libgaim/protocols/jabber/chat.c =================================================================== --- trunk/libgaim/protocols/jabber/chat.c 2006-09-06 03:12:05 UTC (rev 17176) +++ trunk/libgaim/protocols/jabber/chat.c 2006-09-06 03:58:53 UTC (rev 17177) @@ -205,7 +205,7 @@ GaimPresence *gpresence; GaimStatus *status; JabberBuddyState state; - const char *msg; + char *msg; int priority; room = g_hash_table_lookup(data, "room"); @@ -265,6 +265,7 @@ full_jid = g_strdup_printf("%s/%s", room_jid, handle); xmlnode_set_attrib(presence, "to", full_jid); g_free(full_jid); + g_free(msg); x = xmlnode_new_child(presence, "x"); xmlnode_set_namespace(x, "http://jabber.org/protocol/muc"); @@ -618,7 +619,7 @@ GaimPresence *gpresence; GaimStatus *status; JabberBuddyState state; - const char *msg; + char *msg; int priority; if(!chat->muc) { @@ -637,6 +638,7 @@ full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, nick); xmlnode_set_attrib(presence, "to", full_jid); g_free(full_jid); + g_free(msg); jabber_send(chat->js, presence); xmlnode_free(presence); Modified: trunk/libgaim/protocols/jabber/presence.c =================================================================== --- trunk/libgaim/protocols/jabber/presence.c 2006-09-06 03:12:05 UTC (rev 17176) +++ trunk/libgaim/protocols/jabber/presence.c 2006-09-06 03:58:53 UTC (rev 17177) @@ -66,7 +66,7 @@ JabberBuddyResource *jbr; if((jb = jabber_buddy_find(js, my_base_jid, TRUE))) { JabberBuddyState state; - const char *msg; + char *msg; int priority; gaim_status_to_jabber(gstatus, &state, &msg, &priority); @@ -81,6 +81,8 @@ } else { gaim_prpl_got_user_status(js->gc->account, my_base_jid, "offline", msg ? "message" : NULL, msg, NULL); } + + g_free(msg); } } g_free(my_base_jid); @@ -95,7 +97,6 @@ int primitive; xmlnode *presence, *x, *photo; char *stripped = NULL; - const char *msg; JabberBuddyState state; int priority; @@ -111,10 +112,8 @@ gc = gaim_account_get_connection(account); js = gc->proto_data; - gaim_status_to_jabber(status, &state, &msg, &priority); + gaim_status_to_jabber(status, &state, &stripped, &priority); - if(msg) - gaim_markup_html_to_xhtml(msg, NULL, &stripped); presence = jabber_presence_create(state, stripped, priority); g_free(stripped); @@ -604,9 +603,10 @@ xmlnode_free(presence); } -void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, const char **msg, int *priority) +void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, char **msg, int *priority) { const char *status_id = NULL; + const char *formatted_msg = NULL; if(state) *state = JABBER_BUDDY_STATE_UNKNOWN; if(msg) *msg = NULL; @@ -621,11 +621,14 @@ } if(msg) { - *msg = gaim_status_get_attr_string(status, "message"); + formatted_msg = gaim_status_get_attr_string(status, "message"); /* if the message is blank, then there really isn't a message */ - if(*msg && !**msg) - *msg = NULL; + if(formatted_msg && !*formatted_msg) + formatted_msg = NULL; + + if(formatted_msg) + gaim_markup_html_to_xhtml(formatted_msg, NULL, msg); } if(priority) Modified: trunk/libgaim/protocols/jabber/presence.h =================================================================== --- trunk/libgaim/protocols/jabber/presence.h 2006-09-06 03:12:05 UTC (rev 17176) +++ trunk/libgaim/protocols/jabber/presence.h 2006-09-06 03:58:53 UTC (rev 17177) @@ -32,6 +32,6 @@ void jabber_presence_subscription_set(JabberStream *js, const char *who, const char *type); void jabber_presence_fake_to_self(JabberStream *js, const GaimStatus *status); -void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, const char **msg, int *priority); +void gaim_status_to_jabber(const GaimStatus *status, JabberBuddyState *state, char **msg, int *priority); #endif /* _GAIM_JABBER_PRESENCE_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-19 23:46:20
|
Revision: 17325 http://svn.sourceforge.net/gaim/?rev=17325&view=rev Author: thekingant Date: 2006-09-19 16:46:17 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Why would someone not want to use TLS? Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-09-19 23:43:09 UTC (rev 17324) +++ trunk/libgaim/protocols/jabber/auth.c 2006-09-19 23:46:17 UTC (rev 17325) @@ -41,17 +41,12 @@ xmlnode *starttls; if((starttls = xmlnode_get_child(packet, "starttls"))) { - if(gaim_account_get_bool(js->gc->account, "use_tls", TRUE) && - gaim_ssl_is_supported()) { + if(gaim_ssl_is_supported()) { jabber_send_raw(js, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1); return TRUE; } else if(xmlnode_get_child(starttls, "required")) { - if(gaim_ssl_is_supported()) { - gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. Select \"Use TLS if available\" in account properties")); - } else { - gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. No TLS/SSL support found.")); - } + gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. No TLS/SSL support found.")); return TRUE; } } Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:43:09 UTC (rev 17324) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:46:17 UTC (rev 17325) @@ -1961,11 +1961,6 @@ split = gaim_account_user_split_new(_("Resource"), "Home", '/'); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); - option = gaim_account_option_bool_new(_("Use TLS if available"), "use_tls", - TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, - option); - option = gaim_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-09-27 02:07:10
|
Revision: 17381 http://svn.sourceforge.net/gaim/?rev=17381&view=rev Author: datallah Date: 2006-09-26 19:07:06 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Fix some signedness warnings Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/oob.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-27 02:01:29 UTC (rev 17380) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-27 02:07:06 UTC (rev 17381) @@ -402,10 +402,10 @@ #ifdef HAVE_CYRUS_SASL if (js->sasl_maxbuf>0) { const char *out; - int olen; + unsigned int olen; sasl_decode(js->sasl, buf, len, &out, &olen); if (olen>0) { - gaim_debug(GAIM_DEBUG_INFO, "jabber", "RecvSASL (%d): %s\n", olen, out); + gaim_debug(GAIM_DEBUG_INFO, "jabber", "RecvSASL (%u): %s\n", olen, out); jabber_parser_process(js,out,olen); } return; Modified: trunk/libgaim/protocols/jabber/oob.c =================================================================== --- trunk/libgaim/protocols/jabber/oob.c 2006-09-27 02:01:29 UTC (rev 17380) +++ trunk/libgaim/protocols/jabber/oob.c 2006-09-27 02:07:06 UTC (rev 17381) @@ -143,7 +143,7 @@ tmp += 4; - *buffer = g_strdup(tmp); + *buffer = (unsigned char*) g_strdup(tmp); return strlen(tmp); } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-01 09:47:20
|
Revision: 17867 http://svn.sourceforge.net/gaim/?rev=17867&view=rev Author: thekingant Date: 2006-12-01 01:47:20 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Get rid of some silly casting Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c trunk/libgaim/protocols/jabber/buddy.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-12-01 08:07:17 UTC (rev 17866) +++ trunk/libgaim/protocols/jabber/auth.c 2006-12-01 09:47:20 UTC (rev 17867) @@ -740,7 +740,7 @@ { const char *ns = xmlnode_get_namespace(packet); #ifdef HAVE_CYRUS_SASL - int *x; + const int *x; #endif if(!ns || strcmp(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) { @@ -762,9 +762,9 @@ } } /* If we've negotiated a security layer, we need to enable it */ - sasl_getprop(js->sasl, SASL_SSF, (const void **)&x); - if (*x>0) { - sasl_getprop(js->sasl, SASL_MAXOUTBUF, (const void **)&x); + sasl_getprop(js->sasl, SASL_SSF, &x); + if (*x > 0) { + sasl_getprop(js->sasl, SASL_MAXOUTBUF, &x); js->sasl_maxbuf = *x; } #endif Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2006-12-01 08:07:17 UTC (rev 17866) +++ trunk/libgaim/protocols/jabber/buddy.c 2006-12-01 09:47:20 UTC (rev 17867) @@ -68,6 +68,9 @@ JabberBuddy *jb; const char *realname; + if (js->buddies == NULL) + return NULL; + if(!(realname = jabber_normalize(js->gc->account, name))) return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2007-02-13 22:21:36
|
Revision: 18189 http://svn.sourceforge.net/gaim/?rev=18189&view=rev Author: evands Date: 2007-02-13 14:21:30 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Three memory leak fixes; the leaks were found by David Smith Modified Paths: -------------- trunk/libgaim/protocols/jabber/buddy.c trunk/libgaim/protocols/jabber/roster.c Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2007-02-09 17:16:32 UTC (rev 18188) +++ trunk/libgaim/protocols/jabber/buddy.c 2007-02-13 22:21:30 UTC (rev 18189) @@ -642,7 +642,9 @@ } if(jbir) { if(jbir->idle_seconds > 0) { - gaim_notify_user_info_add_pair(user_info, _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); + char *idle = gaim_str_seconds_to_string(jbir->idle_seconds); + gaim_notify_user_info_add_pair(user_info, _("Idle"), idle); + g_free(idle); } } if(jbr && jbr->client.name) { @@ -680,7 +682,9 @@ if(jbir) { if(jbir->idle_seconds > 0) { - gaim_notify_user_info_add_pair(user_info, _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); + char *idle = gaim_str_seconds_to_string(jbir->idle_seconds); + gaim_notify_user_info_add_pair(user_info, _("Idle"), idle); + g_free(idle); } } if(jbr && jbr->client.name) { @@ -729,6 +733,7 @@ while(l) { if(!strcmp(id, l->data)) { jbi->ids = g_slist_remove(jbi->ids, l->data); + g_free(l->data); return; } l = l->next; Modified: trunk/libgaim/protocols/jabber/roster.c =================================================================== --- trunk/libgaim/protocols/jabber/roster.c 2007-02-09 17:16:32 UTC (rev 18188) +++ trunk/libgaim/protocols/jabber/roster.c 2007-02-13 22:21:30 UTC (rev 18189) @@ -176,7 +176,7 @@ char *jid_norm; const char *username; - jid_norm = g_strdup(jabber_normalize(js->gc->account, jid)); + jid_norm = jabber_normalize(js->gc->account, jid); username = gaim_account_get_username(js->gc->account); me = g_utf8_collate(jid_norm, jabber_normalize(js->gc->account, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2007-03-03 19:25:35
|
Revision: 18197 http://svn.sourceforge.net/gaim/?rev=18197&view=rev Author: faceprint Date: 2007-03-03 11:25:26 -0800 (Sat, 03 Mar 2007) Log Message: ----------- sf patch 1663064 Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/jabber.h Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2007-02-26 04:30:15 UTC (rev 18196) +++ trunk/libgaim/protocols/jabber/auth.c 2007-03-03 19:25:26 UTC (rev 18197) @@ -207,13 +207,7 @@ do { again = FALSE; - /* Use the user's domain for compatibility with the old - * DIGESTMD5 code. Note that this may cause problems where - * the user's domain doesn't match the FQDN of the jabber - * service - */ - - js->sasl_state = sasl_client_new("xmpp", js->user->domain, NULL, NULL, js->sasl_cb, 0, &js->sasl); + js->sasl_state = sasl_client_new("xmpp", js->serverFQDN, NULL, NULL, js->sasl_cb, 0, &js->sasl); if (js->sasl_state==SASL_OK) { sasl_setprop(js->sasl, SASL_SEC_PROPS, &secprops); gaim_debug_info("sasl", "Mechs found: %s\n", js->sasl_mechs->str); @@ -261,6 +255,12 @@ * Presumably, if we get here that isn't the case and we shouldn't try again? * I suspect that this never happens. */ + /* + * SXW: Yes, this is right. What this handles is the situation where a + * mechanism, say GSSAPI, is tried. If that mechanism fails, it may be + * due to mechanism specific issues, so we want to try one of the other + * supported mechanisms. This code handles that case + */ if (mech && strlen(mech) > 0) { char *pos; if ((pos = strstr(js->sasl_mechs->str, mech))) { Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2007-02-26 04:30:15 UTC (rev 18196) +++ trunk/libgaim/protocols/jabber/jabber.c 2007-03-03 19:25:26 UTC (rev 18197) @@ -499,6 +499,9 @@ static void jabber_login_connect(JabberStream *js, const char *server, int port) { +#ifdef HAVE_CYRUS_SASL + js->serverFQDN = g_strdup(server); +#endif if (gaim_proxy_connect(js->gc, js->gc->account, server, port, jabber_login_callback, js->gc) == NULL) gaim_connection_error(js->gc, _("Unable to create socket")); @@ -1002,6 +1005,8 @@ g_string_free(js->sasl_mechs, TRUE); if(js->sasl_cb) g_free(js->sasl_cb); + if(js->serverFQDN) + g_free(js->serverFQDN); #endif g_free(js->server_name); g_free(js->gmail_last_time); Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2007-02-26 04:30:15 UTC (rev 18196) +++ trunk/libgaim/protocols/jabber/jabber.h 2007-03-03 19:25:26 UTC (rev 18197) @@ -145,6 +145,7 @@ int sasl_state; int sasl_maxbuf; GString *sasl_mechs; + char *serverFQDN; #endif } JabberStream; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |