1.1 --- a/gmyth/src/gmyth_file_transfer.c Fri Nov 24 21:43:04 2006 +0000
1.2 +++ b/gmyth/src/gmyth_file_transfer.c Fri Nov 24 21:49:40 2006 +0000
1.3 @@ -148,8 +148,6 @@
1.4 static void
1.5 gmyth_file_transfer_dispose (GObject *object)
1.6 {
1.7 - GMythFileTransfer *gmyth_file_transfer = GMYTH_FILE_TRANSFER(object);
1.8 -
1.9 G_OBJECT_CLASS (gmyth_file_transfer_parent_class)->dispose (object);
1.10 }
1.11
1.12 @@ -237,52 +235,6 @@
1.13 gmyth_socket_write_stringlist (transfer->sock, strlist );
1.14 gmyth_socket_read_stringlist (transfer->sock, strlist );
1.15
1.16 - GIOChannel* io_channel = (*transfer)->sock->sd_io_ch,
1.17 - *io_channel_control = (*transfer)->control_sock->sd_io_ch;
1.18 - GIOCondition io_cond, io_cond_control;
1.19 - GIOStatus io_status = G_IO_STATUS_NORMAL;
1.20 - GError *error = NULL;
1.21 - gchar *trash = NULL;
1.22 - guint bytes_read = 0;
1.23 -
1.24 - io_cond = g_io_channel_get_buffer_condition( io_channel );
1.25 -
1.26 - if ( ( io_cond & G_IO_IN ) != 0 ) {
1.27 - do
1.28 - {
1.29 - trash = g_new0( gchar, GMYTHTV_BUFFER_SIZE );
1.30 -
1.31 - io_status = g_io_channel_read_chars( io_channel, trash,
1.32 - GMYTHTV_BUFFER_SIZE, &bytes_read, &error);
1.33 -
1.34 - g_print( "[%s] cleaning buffer on IO binary channel... %d bytes gone!\n",
1.35 - __FUNCTION__, bytes_read );
1.36 -
1.37 - if ( trash != NULL )
1.38 - g_free( trash );
1.39 -
1.40 - io_cond = g_io_channel_get_buffer_condition( io_channel );
1.41 -
1.42 - } while ( ( io_cond & G_IO_IN ) != 0 && ( io_status != G_IO_STATUS_ERROR ) && (error == NULL) );
1.43 -
1.44 - }
1.45 -
1.46 - io_cond_control = g_io_channel_get_buffer_condition( io_channel_control );
1.47 -
1.48 - if ( ( io_cond_control & G_IO_IN ) != 0 ) {
1.49 - g_print( "[%s] Finishind reading function: cleaning all data on the I/O control socket...\n", __FUNCTION__ );
1.50 - while ( gmyth_socket_read_stringlist( (*transfer)->control_sock, strlist ) > 0 )
1.51 - {
1.52 - if ( strlist != NULL && gmyth_string_list_length(strlist) > 0 )
1.53 - {
1.54 - gint backend_code = gmyth_string_list_get_int( strlist, 0 ); // -1 on backend error
1.55 - g_print( "[%s]\t backend code = %d -\t"\
1.56 - "[%s prepared for reading]! (G_IO_IN) !!!\n\n", __FUNCTION__,
1.57 - backend_code, ( ( io_cond & G_IO_IN ) != 0 ) ? "IS" : "IS NOT" );
1.58 - }
1.59 - }
1.60 - }
1.61 -
1.62 /* file identification used in future file transfer requests to backend */
1.63 transfer->file_id = gmyth_string_list_get_int( strlist, 1 );
1.64
1.65 @@ -458,7 +410,7 @@
1.66 }
1.67
1.68 gint
1.69 -gmyth_file_transfer_read(GMythFileTransfer *transfer, GByteArray *data, gint size, gboolean read_unlimited)
1.70 +gmyth_file_transfer_read(GMythFileTransfer *transfer, void *data, gint size, gboolean read_unlimited)
1.71 {
1.72 gsize bytes_sent = 0;
1.73 gsize bytes_read = 0;