Mercurial > pidgin
comparison libpurple/protocols/msn/slplink.c @ 30862:5ad928319db0
Use the SlpMessage header offset only instead of it and the one on the SlpMessage when sending it. This fixes sending big data which needs to be split in multiple messages.
author | masca@cpw.pidgin.im |
---|---|
date | Wed, 04 Aug 2010 04:30:03 +0000 |
parents | 2c2ca0aed68e |
children | 16ab805406d1 |
comparison
equal
deleted
inserted
replaced
30861:4445ae4215b8 | 30862:5ad928319db0 |
---|---|
296 part = msn_slpmsgpart_new(slpmsg->header, slpmsg->footer); | 296 part = msn_slpmsgpart_new(slpmsg->header, slpmsg->footer); |
297 part->ack_data = slpmsg; | 297 part->ack_data = slpmsg; |
298 | 298 |
299 real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size; | 299 real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size; |
300 | 300 |
301 if (slpmsg->offset < real_size) | 301 if (slpmsg->header->offset < real_size) |
302 { | 302 { |
303 if (slpmsg->slpcall && slpmsg->slpcall->xfer && purple_xfer_get_type(slpmsg->slpcall->xfer) == PURPLE_XFER_SEND && | 303 if (slpmsg->slpcall && slpmsg->slpcall->xfer && purple_xfer_get_type(slpmsg->slpcall->xfer) == PURPLE_XFER_SEND && |
304 purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED) | 304 purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED) |
305 { | 305 { |
306 len = MIN(MSN_SBCONN_MAX_SIZE, slpmsg->slpcall->u.outgoing.len); | 306 len = MIN(MSN_SBCONN_MAX_SIZE, slpmsg->slpcall->u.outgoing.len); |
307 msn_slpmsgpart_set_bin_data(part, slpmsg->slpcall->u.outgoing.data, len); | 307 msn_slpmsgpart_set_bin_data(part, slpmsg->slpcall->u.outgoing.data, len); |
308 } | 308 } |
309 else | 309 else |
310 { | 310 { |
311 len = slpmsg->size - slpmsg->offset; | 311 len = slpmsg->size - slpmsg->header->offset; |
312 | 312 |
313 if (len > MSN_SBCONN_MAX_SIZE) | 313 if (len > MSN_SBCONN_MAX_SIZE) |
314 len = MSN_SBCONN_MAX_SIZE; | 314 len = MSN_SBCONN_MAX_SIZE; |
315 | 315 |
316 msn_slpmsgpart_set_bin_data(part, slpmsg->buffer + slpmsg->offset, len); | 316 msn_slpmsgpart_set_bin_data(part, slpmsg->buffer + slpmsg->header->offset, len); |
317 } | 317 } |
318 | 318 |
319 slpmsg->header->offset = slpmsg->offset; | |
320 slpmsg->header->length = len; | 319 slpmsg->header->length = len; |
321 } | 320 } |
322 | 321 |
323 #if 0 | 322 #if 0 |
324 /* TODO: port this function to SlpMessageParts */ | 323 /* TODO: port this function to SlpMessageParts */ |
341 slpmsg->slpcall->progress = TRUE; | 340 slpmsg->slpcall->progress = TRUE; |
342 | 341 |
343 if (slpmsg->slpcall->progress_cb != NULL) | 342 if (slpmsg->slpcall->progress_cb != NULL) |
344 { | 343 { |
345 slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, | 344 slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, |
346 len, slpmsg->offset); | 345 len, slpmsg->header->offset); |
347 } | 346 } |
348 } | 347 } |
349 | 348 |
350 /* slpmsg->offset += len; */ | 349 /* slpmsg->offset += len; */ |
351 } | 350 } |