[Pidgin] #9841: non seekable stream and file transfer.

Pidgin trac at pidgin.im
Fri Aug 28 18:53:20 EDT 2009


#9841: non seekable stream and file transfer.
---------------------+------------------------------------------------------
 Reporter:  kenshin  |        Owner:           
     Type:  patch    |       Status:  new      
Milestone:  2.7.0    |    Component:  libpurple
  Version:           |   Resolution:           
 Keywords:  ft       |  
---------------------+------------------------------------------------------

Comment(by kenshin):

 Replying to [comment:13 darkrain42]:
 > Replying to [comment:12 kenshin]:
 > > cool. I will.
 > > But :
 > > what becomes of  ui_ops->data_not_sent?
 > > should libepurple delegate to the ui if the ui wants to ?
 >
 > Those three UI ops (read/write/data_not_sent) are for delegating to the
 UI.
 >
 > I would suggest (I'm not sure if this will work or not; ideally it could
 be made simplier) doing something like:
 > {{{
 > if (priv->byte_array) {
 >     append bytes to priv->byte_array;
 >     r = purple_xfer_write(xfer, priv->byte_array);
 > } else
 >     r = purple_xfer_write(xfer, bytes);
 >
 > if (r == -1) {
 >     ...
 > } else if (priv->byte_array == NULL && r < result && ui_ops &&
 ui_ops->data_not_sent) {
 >     /* that check is ugly */
 >     ui_ops->data_not_sent(...);
 > } else if ((priv->byte_array && priv->byte_array->len == r) || (result
 == r)) {
 >     /* do that buffer size increasing stuff */
 > }
 > }}}

 that's exxactly the kinf of ifs and elses I wanted to avoid (I'm lazy :P)
 sure i'll rewrite it to take into account the delegation.

 > >
 > > freeing the GbyteArray in _xfer_destroy  -- at first glance _xfer_end
 is never called when the transfer is canceled either locally or remotely
 >
 > Hmm, you're right. It looks like purple_xfer_cancel_(local|remote)
 contain the same logic. I guess what you have is fine (although I think
 I'm going to refactor those three functions to reduce code duplication...)
 >
 > You also should remove the GLIB_CHECK_VERSION; Pidgin 2.7.0 will require
 glib 2.12, so g_byte_array_remove_range is fine.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/9841#comment:14>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list