Commit 030cf5fe authored by Steven Fackler's avatar Steven Fackler
Browse files

Fix for IO changes

parent cfe9df78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
use std::os;
use std::io::fs::PathExtensions;
use std::old_io::fs::PathExtensions;

pub struct ProbeResult {
    pub cert_file: Option<Path>,
+3 −3
Original line number Diff line number Diff line
use libc::{c_void, c_int};
use std::io::{EndOfFile, IoResult, IoError, OtherIoError};
use std::io::{Reader, Writer};
use std::old_io::{EndOfFile, IoResult, IoError, OtherIoError};
use std::old_io::{Reader, Writer};
use std::ptr;

use ffi;
@@ -87,7 +87,7 @@ impl Reader for MemBio {
}

impl Writer for MemBio {
    fn write(&mut self, buf: &[u8]) -> IoResult<()> {
    fn write_all(&mut self, buf: &[u8]) -> IoResult<()> {
        let ret = unsafe {
            ffi::BIO_write(self.bio, buf.as_ptr() as *const c_void,
                           buf.len() as c_int)
+4 −4
Original line number Diff line number Diff line
use libc::c_uint;
use std::ptr;
use std::io;
use std::old_io;
use std::iter::repeat;

use ffi;
@@ -59,8 +59,8 @@ pub struct Hasher {
    len: u32,
}

impl io::Writer for Hasher {
    fn write(&mut self, buf: &[u8]) -> io::IoResult<()> {
impl old_io::Writer for Hasher {
    fn write_all(&mut self, buf: &[u8]) -> old_io::IoResult<()> {
        self.update(buf);
        Ok(())
    }
@@ -163,7 +163,7 @@ mod tests {

    pub fn hash_writer(t: super::HashType, data: &[u8]) -> Vec<u8> {
        let mut h = super::Hasher::new(t);
        h.write(data).unwrap();
        h.write_all(data).unwrap();
        h.finalize()
    }

+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ impl PKey {

        }
        let buf = try!(mem_bio.read_to_end().map_err(StreamError));
        writer.write(buf.as_slice()).map_err(StreamError)
        writer.write_all(buf.as_slice()).map_err(StreamError)
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ use libc::c_ulong;
use std::error;
use std::fmt;
use std::ffi::c_str_to_bytes;
use std::io::IoError;
use std::old_io::IoError;

use ffi;

Loading