Updates for upstream changes
This commit is contained in:
parent
ec82c45cc9
commit
613ceec630
@ -246,7 +246,7 @@ impl<'conn > Iterator<PostgresNotification> for PostgresNotifications<'conn> {
|
|||||||
/// `next` may return `Some` notification after returning `None` if a new
|
/// `next` may return `Some` notification after returning `None` if a new
|
||||||
/// notification was received.
|
/// notification was received.
|
||||||
fn next(&mut self) -> Option<PostgresNotification> {
|
fn next(&mut self) -> Option<PostgresNotification> {
|
||||||
self.conn.conn.with_mut(|conn| { conn.notifications.pop_front() })
|
self.conn.conn.borrow_mut().notifications.pop_front()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ impl<R: Reader> ReadMessage for R {
|
|||||||
let ident = try!(self.read_u8());
|
let ident = try!(self.read_u8());
|
||||||
// subtract size of length value
|
// subtract size of length value
|
||||||
let len = try!(self.read_be_i32()) as uint - mem::size_of::<i32>();
|
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 {
|
let ret = match ident as char {
|
||||||
'1' => ParseComplete,
|
'1' => ParseComplete,
|
||||||
@ -321,7 +321,7 @@ fn read_data_row(buf: &mut MemReader) -> IoResult<BackendMessage> {
|
|||||||
for _ in range(0, len) {
|
for _ in range(0, len) {
|
||||||
let val = match try!(buf.read_be_i32()) {
|
let val = match try!(buf.read_be_i32()) {
|
||||||
-1 => None,
|
-1 => None,
|
||||||
len => Some(try!(buf.read_bytes(len as uint)))
|
len => Some(try!(buf.read_exact(len as uint)))
|
||||||
};
|
};
|
||||||
values.push(val);
|
values.push(val);
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ fn read_auth_message(buf: &mut MemReader) -> IoResult<BackendMessage> {
|
|||||||
0 => AuthenticationOk,
|
0 => AuthenticationOk,
|
||||||
2 => AuthenticationKerberosV5,
|
2 => AuthenticationKerberosV5,
|
||||||
3 => AuthenticationCleartextPassword,
|
3 => AuthenticationCleartextPassword,
|
||||||
5 => AuthenticationMD5Password { salt: try!(buf.read_bytes(4)) },
|
5 => AuthenticationMD5Password { salt: try!(buf.read_exact(4)) },
|
||||||
6 => AuthenticationSCMCredential,
|
6 => AuthenticationSCMCredential,
|
||||||
7 => AuthenticationGSS,
|
7 => AuthenticationGSS,
|
||||||
9 => AuthenticationSSPI,
|
9 => AuthenticationSSPI,
|
||||||
|
@ -125,7 +125,7 @@ impl Drop for PooledPostgresConnection {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let conn = RefCell::new(self.conn.take());
|
let conn = RefCell::new(self.conn.take());
|
||||||
self.pool.pool.access(|pool| {
|
self.pool.pool.access(|pool| {
|
||||||
pool.pool.push(conn.with_mut(|r| r.take_unwrap()));
|
pool.pool.push(conn.borrow_mut().take_unwrap());
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -475,13 +475,13 @@ impl FromSql for Option<HashMap<~str, Option<~str>>> {
|
|||||||
|
|
||||||
for _ in range(0, count) {
|
for _ in range(0, count) {
|
||||||
let key_len = or_fail!(rdr.read_be_i32());
|
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_len = or_fail!(rdr.read_be_i32());
|
||||||
let val = if val_len < 0 {
|
let val = if val_len < 0 {
|
||||||
None
|
None
|
||||||
} else {
|
} 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);
|
map.insert(key, val);
|
||||||
|
Loading…
Reference in New Issue
Block a user