Updates for upstream changes

This commit is contained in:
Steven Fackler 2014-03-22 21:20:22 -07:00
parent ec82c45cc9
commit 613ceec630
4 changed files with 7 additions and 7 deletions

View File

@ -246,7 +246,7 @@ impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
/// `next` may return `Some` notification after returning `None` if a new
/// notification was received.
fn next(&mut self) -> Option<PostgresNotification> {
self.conn.conn.with_mut(|conn| { conn.notifications.pop_front() })
self.conn.conn.borrow_mut().notifications.pop_front()
}
}

View File

@ -263,7 +263,7 @@ impl<R: Reader> ReadMessage for R {
let ident = try!(self.read_u8());
// subtract size of length value
let len = try!(self.read_be_i32()) as uint - mem::size_of::<i32>();
let mut buf = MemReader::new(try!(self.read_bytes(len)));
let mut buf = MemReader::new(try!(self.read_exact(len)));
let ret = match ident as char {
'1' => ParseComplete,
@ -321,7 +321,7 @@ fn read_data_row(buf: &mut MemReader) -> IoResult<BackendMessage> {
for _ in range(0, len) {
let val = match try!(buf.read_be_i32()) {
-1 => None,
len => Some(try!(buf.read_bytes(len as uint)))
len => Some(try!(buf.read_exact(len as uint)))
};
values.push(val);
}
@ -334,7 +334,7 @@ fn read_auth_message(buf: &mut MemReader) -> IoResult<BackendMessage> {
0 => AuthenticationOk,
2 => AuthenticationKerberosV5,
3 => AuthenticationCleartextPassword,
5 => AuthenticationMD5Password { salt: try!(buf.read_bytes(4)) },
5 => AuthenticationMD5Password { salt: try!(buf.read_exact(4)) },
6 => AuthenticationSCMCredential,
7 => AuthenticationGSS,
9 => AuthenticationSSPI,

View File

@ -125,7 +125,7 @@ impl Drop for PooledPostgresConnection {
fn drop(&mut self) {
let conn = RefCell::new(self.conn.take());
self.pool.pool.access(|pool| {
pool.pool.push(conn.with_mut(|r| r.take_unwrap()));
pool.pool.push(conn.borrow_mut().take_unwrap());
})
}
}

View File

@ -475,13 +475,13 @@ impl FromSql for Option<HashMap<~str, Option<~str>>> {
for _ in range(0, count) {
let key_len = or_fail!(rdr.read_be_i32());
let key = str::from_utf8_owned(or_fail!(rdr.read_bytes(key_len as uint))).unwrap();
let key = str::from_utf8_owned(or_fail!(rdr.read_exact(key_len as uint))).unwrap();
let val_len = or_fail!(rdr.read_be_i32());
let val = if val_len < 0 {
None
} else {
Some(str::from_utf8_owned(or_fail!(rdr.read_bytes(val_len as uint))).unwrap())
Some(str::from_utf8_owned(or_fail!(rdr.read_exact(val_len as uint))).unwrap())
};
map.insert(key, val);