comparison libpurple/protocols/simple/simple.c @ 24967:adf153852bcf

propagate from branch 'im.pidgin.pidgin' (head df86c6f1de324e87828356aa8d5c369abd533b58) to branch 'im.pidgin.pidgin.vv' (head 5bf87e309f2fee61842cccf4992de4866349570c)
author Mike Ruprecht <maiku@soc.pidgin.im>
date Mon, 24 Nov 2008 10:59:08 +0000
parents e22bcca9f2b2 7d07bb66f70b
children 25e2ab1fff1d
comparison
equal deleted inserted replaced
24966:bee5ab815291 24967:adf153852bcf
1226 { 1226 {
1227 g_strchug(ssparts[i]); 1227 g_strchug(ssparts[i]);
1228 if (purple_str_has_prefix(ssparts[i], "terminated")) 1228 if (purple_str_has_prefix(ssparts[i], "terminated"))
1229 { 1229 {
1230 purple_debug_info("simple", "Subscription expired!"); 1230 purple_debug_info("simple", "Subscription expired!");
1231 g_free(b->dialog->ourtag); 1231 if (b->dialog)
1232 g_free(b->dialog->theirtag); 1232 {
1233 g_free(b->dialog->callid); 1233 g_free(b->dialog->ourtag);
1234 g_free(b->dialog); 1234 g_free(b->dialog->theirtag);
1235 b->dialog = NULL; 1235 g_free(b->dialog->callid);
1236 g_free(b->dialog);
1237 b->dialog = NULL;
1238 }
1236 1239
1237 purple_prpl_got_user_status(sip->account, from, "offline", NULL); 1240 purple_prpl_got_user_status(sip->account, from, "offline", NULL);
1238 break; 1241 break;
1239 } 1242 }
1240 i++; 1243 i++;
1625 time_t currtime = time(NULL); 1628 time_t currtime = time(NULL);
1626 cur += 2; 1629 cur += 2;
1627 cur[0] = '\0'; 1630 cur[0] = '\0';
1628 purple_debug_info("simple", "\n\nreceived - %s\n######\n%s\n#######\n\n", ctime(&currtime), conn->inbuf); 1631 purple_debug_info("simple", "\n\nreceived - %s\n######\n%s\n#######\n\n", ctime(&currtime), conn->inbuf);
1629 msg = sipmsg_parse_header(conn->inbuf); 1632 msg = sipmsg_parse_header(conn->inbuf);
1633
1634 if(!msg) {
1635 /* Should we re-use this error message (from lower in the function)? */
1636 purple_debug_misc("simple", "received a incomplete sip msg: %s\n", conn->inbuf);
1637 return;
1638 }
1639
1630 cur[0] = '\r'; 1640 cur[0] = '\r';
1631 cur += 2; 1641 cur += 2;
1632 restlen = conn->inbufused - (cur - conn->inbuf); 1642 restlen = conn->inbufused - (cur - conn->inbuf);
1633 if(restlen >= msg->bodylen) { 1643 if(restlen >= msg->bodylen) {
1634 dummy = g_malloc(msg->bodylen + 1); 1644 dummy = g_malloc(msg->bodylen + 1);