--- Monitor.pm,old 2007-11-06 16:12:21.000000000 -0800 +++ Monitor.pm 2007-11-06 16:47:38.000000000 -0800 @@ -167,7 +167,7 @@ # function caches what it's already created. $dev->create_directory("/dev$devid/test-write"); - my $num = int(rand 10000); # this was "$$-$now" before, but we don't yet have a cleaner in mogstored for these files + my $num = "$$-$now"; my $puturl = "http://$hostip:$port/dev$devid/test-write/test-write-$num"; my $content = "time=$now rand=$num"; my $req = HTTP::Request->new(PUT => $puturl); @@ -181,12 +181,16 @@ # now let's get it back to verify; note we use the get_port to verify that # the distinction works (if we have one) my $geturl = "http://$hostip:$get_port/dev$devid/test-write/test-write-$num"; - my $testwrite = $ua->get($geturl); + my $reqget = HTTP::Request->new(GET => $geturl); + my $testwrite = $ua->request($reqget); # if success and the content matches, mark it writeable if ($testwrite->is_success && $testwrite->content eq $content) { $self->broadcast_device_writeable($devid); debug("dev$devid: used = $used, total = $total, writeable = 1"); + # delete the test file we wrote + $reqget->method('DELETE'); + $ua->request( $reqget ); return; } }