summaryrefslogtreecommitdiff
path: root/chat/mu-conference/patches/patch-ab
blob: 17e1de2c3859b96c725330f1d5e32e6e00ec5b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$NetBSD: patch-ab,v 1.1 2004/07/22 18:02:10 kristerw Exp $

--- jcomp/jcr_elements.c.orig	Thu Jul 22 19:49:51 2004
+++ jcomp/jcr_elements.c	Thu Jul 22 19:51:32 2004
@@ -32,6 +32,8 @@
     if (strncasecmp(name, "stream:stream", 13) == 0) {
       char *pass = xmlnode_get_data(xmlnode_get_tag(jcr->config,"secret"));
       int i = 0;
+      char hashbuf[41];
+      xmlnode cur;
       if (attrib == NULL) return;
       while (attrib[i] != '\0') {
         if (strncasecmp(attrib[i], "id", 2) == 0)
@@ -39,12 +41,11 @@
         i += 2;
       }
       p = pool_new();
-      char hashbuf[41];
       //    log_debug(JDBG, "%s = '%s'", attrib[i], attrib[i+1]);
       shahash_r(spools(p, attrib[i + 1], pass, p), hashbuf);
 
       /* Build a handshake packet */
-      xmlnode cur = xmlnode_new_tag("handshake");
+      cur = xmlnode_new_tag("handshake");
       xmlnode_insert_cdata(cur, hashbuf, -1);
 
       /* Transmit handshake */
@@ -91,6 +92,7 @@
     if (jcr->current == NULL) {
       g_io_channel_close(jcr->gio);
     } else {
+      xmlnode parent;
       if (strncasecmp(name, "stream:error", 12) == 0) {
         log_warn(JDBG, "%s", xmlnode2str(jcr->current));
         g_io_channel_write_chars(jcr->gio, "</stream:stream>", 15, &bytes, NULL);
@@ -100,7 +102,7 @@
         break;
       }
 
-      xmlnode parent = xmlnode_get_parent(jcr->current);
+      parent = xmlnode_get_parent(jcr->current);
       if (parent == NULL) {
         x = xmlnode_dup(jcr->current);
         to = jid_new(x->p, xmlnode_get_attrib(x, "to"));