[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

bug in Gnome2::VFS?



If I run the attached script, I get this crash:

james pioneer:~$ perl vfstest.pl 
Use of uninitialized value in subtraction (-) at vfstest.pl line 26.
libgnomevfs-CRITICAL **: file gnome-vfs-socket-buffer.c: line 169
(gnome_vfs_socket_buffer_read): assertion `buffer != NULL' failed at
vfstest.pl line 26.
Segmentation fault

It works fine if I replace $url with something less funky, like
"http://teyandei.net/index.html"; instead of what is in the script now,
"http://sourceforge.net/export/rss2_projnews.php?group_id=64773&rss_fulltext=1";

What's going on here?

-- 
James Curbo <james teyandei net>
http://teyandei.net/
GPG Fingerprint: AA8B D78D 6789 84E2 17A5 0F2A C4CA 6A55 0A4B 263F
use strict;
use warnings;

use Gnome2::VFS;


Gnome2::VFS->init;

my $url = 'http://sourceforge.net/export/rss2_projnews.php?group_id=64773&rss_fulltext=1';

my ($result, $handle, $info);

($result, $handle) = Gnome2::VFS->open($url, "read");
die "Problem: $@" unless $result eq "ok";

($result, $info) = $handle->get_file_info("default");
die "Problem: $@" unless $result eq "ok";

my $bytes = $info->{size};

my $bytes_read = 0;
my $buffer = "";

do {
	my ($tmp_buffer, $tmp_bytes_read);
	($result, $tmp_bytes_read, $tmp_buffer) = $handle->read($bytes - $bytes_read);
	die "Problem: $@" unless $result eq "ok";
	$buffer .= $tmp_buffer;
	$bytes_read += $tmp_bytes_read;
} while ($result eq "ok" and $bytes_read < $bytes);

$result = $handle->close();
die "Problem: $@" unless $result eq "ok";

print $buffer;

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]