aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/net/file_loader.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-03-14 12:55:57 -0400
committerLars Bergstrom <lars@lars.com>2014-03-18 09:30:35 -0500
commitf279abbf9f894641f592fee7f70fa0e29d955dad (patch)
tree807167e3e53339ac6342c2c71e0062bfd4b0d82b /src/components/net/file_loader.rs
parentbbac8aa5c3d95e70151b824ca3443f0fb4d9b5a5 (diff)
downloadservo-f279abbf9f894641f592fee7f70fa0e29d955dad.tar.gz
servo-f279abbf9f894641f592fee7f70fa0e29d955dad.zip
Remove all traces of Box representation from bindings. Work around file read runtime problem.
Diffstat (limited to 'src/components/net/file_loader.rs')
-rw-r--r--src/components/net/file_loader.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/net/file_loader.rs b/src/components/net/file_loader.rs
index 336df6e0193..900e295298a 100644
--- a/src/components/net/file_loader.rs
+++ b/src/components/net/file_loader.rs
@@ -13,8 +13,9 @@ static READ_SIZE: uint = 1024;
fn read_all(reader: &mut io::Stream, progress_chan: &Chan<ProgressMsg>)
-> Result<(), ()> {
loop {
- match (reader.read_bytes(READ_SIZE)) {
- Ok(data) => progress_chan.send(Payload(data)),
+ let mut buf = ~[];
+ match (reader.push_bytes(&mut buf, READ_SIZE)) {
+ Ok(_) => progress_chan.send(Payload(buf)),
Err(e) => match e.kind {
io::EndOfFile => return Ok(()),
_ => return Err(()),