Mercurial > pidgin.yaz
comparison libgaim/protocols/jabber/si.c @ 14499:67a6716bf4a7
[gaim-migrate @ 17218]
this should fix file xfer for some folks
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 10 Sep 2006 15:49:50 +0000 |
parents | 8a6154a52b84 |
children | 21bd0369ddd7 |
comparison
equal
deleted
inserted
replaced
14498:26bca01c7076 | 14499:67a6716bf4a7 |
---|---|
129 JabberSIXfer *jsx = xfer->data; | 129 JabberSIXfer *jsx = xfer->data; |
130 struct bytestreams_streamhost *streamhost; | 130 struct bytestreams_streamhost *streamhost; |
131 char *dstaddr, *p; | 131 char *dstaddr, *p; |
132 int i; | 132 int i; |
133 unsigned char hashval[20]; | 133 unsigned char hashval[20]; |
134 JabberID *dstjid; | |
134 | 135 |
135 if(!jsx->streamhosts) { | 136 if(!jsx->streamhosts) { |
136 JabberIq *iq = jabber_iq_new(jsx->js, JABBER_IQ_ERROR); | 137 JabberIq *iq = jabber_iq_new(jsx->js, JABBER_IQ_ERROR); |
137 xmlnode *error, *condition; | 138 xmlnode *error, *condition; |
138 | 139 |
154 return; | 155 return; |
155 } | 156 } |
156 | 157 |
157 streamhost = jsx->streamhosts->data; | 158 streamhost = jsx->streamhosts->data; |
158 | 159 |
159 jsx->gpi = gaim_proxy_info_new(); | 160 dstjid = jabber_id_new(xfer->who); |
160 gaim_proxy_info_set_type(jsx->gpi, GAIM_PROXY_SOCKS5); | 161 |
161 gaim_proxy_info_set_host(jsx->gpi, streamhost->host); | 162 if(dstjid != NULL) { |
162 gaim_proxy_info_set_port(jsx->gpi, streamhost->port); | 163 jsx->gpi = gaim_proxy_info_new(); |
163 | 164 gaim_proxy_info_set_type(jsx->gpi, GAIM_PROXY_SOCKS5); |
164 dstaddr = g_strdup_printf("%s%s%s@%s/%s", jsx->stream_id, xfer->who, jsx->js->user->node, | 165 gaim_proxy_info_set_host(jsx->gpi, streamhost->host); |
165 jsx->js->user->domain, jsx->js->user->resource); | 166 gaim_proxy_info_set_port(jsx->gpi, streamhost->port); |
166 | 167 |
167 gaim_cipher_digest_region("sha1", (guchar *)dstaddr, strlen(dstaddr), | 168 |
168 sizeof(hashval), hashval, NULL); | 169 |
169 g_free(dstaddr); | 170 dstaddr = g_strdup_printf("%s%s@%s/%s%s@%s/%s", jsx->stream_id, dstjid->node, dstjid->domain, dstjid->resource, jsx->js->user->node, |
170 dstaddr = g_malloc(41); | 171 jsx->js->user->domain, jsx->js->user->resource); |
171 p = dstaddr; | 172 |
172 for(i=0; i<20; i++, p+=2) | 173 gaim_cipher_digest_region("sha1", (guchar *)dstaddr, strlen(dstaddr), |
173 snprintf(p, 3, "%02x", hashval[i]); | 174 sizeof(hashval), hashval, NULL); |
174 | 175 g_free(dstaddr); |
175 jsx->connect_data = gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, | 176 dstaddr = g_malloc(41); |
176 jabber_si_bytestreams_connect_cb, xfer); | 177 p = dstaddr; |
177 g_free(dstaddr); | 178 for(i=0; i<20; i++, p+=2) |
179 snprintf(p, 3, "%02x", hashval[i]); | |
180 | |
181 jsx->connect_data = gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, | |
182 jabber_si_bytestreams_connect_cb, xfer); | |
183 g_free(dstaddr); | |
184 | |
185 jabber_id_free(dstjid); | |
186 } | |
178 | 187 |
179 if (jsx->connect_data == NULL) | 188 if (jsx->connect_data == NULL) |
180 { | 189 { |
181 jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); | 190 jsx->streamhosts = g_list_remove(jsx->streamhosts, streamhost); |
182 g_free(streamhost->jid); | 191 g_free(streamhost->jid); |