comparison src/dnssrv.c @ 11426:d678a37c16d9

[gaim-migrate @ 13663] returned wrong number of results committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Fri, 02 Sep 2005 19:33:53 +0000
parents f0e03a3ca3b5
children 4b7087777411
comparison
equal deleted inserted replaced
11425:54fa445aff32 11426:d678a37c16d9
170 static void resolved(gpointer data, gint source, GaimInputCondition cond) { 170 static void resolved(gpointer data, gint source, GaimInputCondition cond) {
171 int size; 171 int size;
172 struct resdata *rdata = (struct resdata*)data; 172 struct resdata *rdata = (struct resdata*)data;
173 struct srv_response *res; 173 struct srv_response *res;
174 struct srv_response *tmp; 174 struct srv_response *tmp;
175 int i;
175 SRVCallback cb = rdata->cb; 176 SRVCallback cb = rdata->cb;
176 177
177 read(source, &size, 4); 178 read(source, &size, 4);
178 gaim_debug_info("srv","found %d SRV entries\n", size); 179 gaim_debug_info("srv","found %d SRV entries\n", size);
179 tmp = res = g_malloc0(sizeof(struct srv_response)*size); 180 tmp = res = g_malloc0(sizeof(struct srv_response)*size);
180 while(size) { 181 i = size;
182 while(i) {
181 read(source, tmp++, sizeof(struct srv_response)); 183 read(source, tmp++, sizeof(struct srv_response));
182 size--; 184 i--;
183 } 185 }
184 cb(res, size, rdata->extradata); 186 cb(res, size, rdata->extradata);
185 gaim_input_remove(rdata->handle); 187 gaim_input_remove(rdata->handle);
186 g_free(rdata); 188 g_free(rdata);
187 } 189 }