… | |
… | |
171 | |
171 | |
172 | faceinfo *f = face_info (facenum); |
172 | faceinfo *f = face_info (facenum); |
173 | |
173 | |
174 | if (!f) |
174 | if (!f) |
175 | { |
175 | { |
176 | LOG (llevError, "client::send_face (%d) out of bounds??\n", facenum); |
176 | LOG (llevError | logBacktrace, "client::send_face (%d) out of bounds??\n", facenum); |
177 | return; |
177 | return; |
178 | } |
178 | } |
179 | |
179 | |
180 | // refuse to send non-image faces |
180 | // refuse to send non-image faces |
181 | if (!fx_want [f->type]) |
181 | if (!fx_want [f->type]) |
… | |
… | |
420 | } |
420 | } |
421 | |
421 | |
422 | sl.printf ("replyinfo image_sums %d %d ", start, stop); |
422 | sl.printf ("replyinfo image_sums %d %d ", start, stop); |
423 | |
423 | |
424 | for (int i = start; i <= stop && i < faces.size (); i++) |
424 | for (int i = start; i <= stop && i < faces.size (); i++) |
425 | { |
425 | if (const faceinfo *f = face_info (i)) |
|
|
426 | if (ns->fx_want [f->type]) |
|
|
427 | { |
426 | ns->faces_sent[i] = true; |
428 | ns->faces_sent[i] = true; |
427 | |
429 | |
428 | const facedata *d = face_data (i, ns->faceset); |
430 | const facedata *d = f->data (ns->faceset); |
429 | |
431 | |
430 | if (sl.room () < 2 + 4 + 1 + d->data.size () + 1) |
432 | if (sl.room () < 2 + 4 + 1 + d->data.size () + 1) |
431 | break; |
433 | break; |
432 | |
434 | |
433 | sl << uint16 (i) |
435 | sl << uint16 (i) |
434 | << uint32 (0) // checksum |
436 | << uint32 (0) // checksum |
435 | << uint8 (ns->faceset); |
437 | << uint8 (ns->faceset); |
436 | |
438 | |
437 | print_facename (sl, *d); sl << uint8 (0); |
439 | print_facename (sl, *d); sl << uint8 (0); |
438 | } |
440 | } |
439 | |
441 | |
440 | /* It would make more sense to catch this pre-emptively in the code above. |
442 | /* It would make more sense to catch this pre-emptively in the code above. |
441 | * however, if this really happens, we probably just want to cut down the |
443 | * however, if this really happens, we probably just want to cut down the |
442 | * size to less than 1000, since that is what we claim the protocol would |
444 | * size to less than 1000, since that is what we claim the protocol would |
443 | * support. |
445 | * support. |
444 | */ |
446 | */ |
445 | //TODO: taken care of above, should simply abort or make sure the above code is correct |
447 | //TODO: taken care of above, should simply abort or make sure the above code is correct |
446 | if (sl.length () >= MAXSOCKBUF) |
448 | if (sl.length () > MAXSOCKBUF) |
447 | { |
449 | { |
448 | LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.length (), MAXSOCKBUF); |
450 | LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.length (), MAXSOCKBUF); |
449 | abort (); |
451 | abort (); |
450 | } |
452 | } |
451 | |
453 | |