44
44
45
45
extern crate bufstream;
46
46
extern crate byteorder;
47
+ extern crate fallible_iterator;
47
48
extern crate hex;
48
49
#[ macro_use]
49
50
extern crate log;
@@ -64,7 +65,7 @@ use postgres_protocol::message::frontend;
64
65
65
66
use error:: { Error , ConnectError , SqlState , DbError } ;
66
67
use io:: TlsHandshake ;
67
- use message:: { Backend , RowDescriptionEntry , ReadMessage } ;
68
+ use message:: { Backend , RowDescriptionEntry } ;
68
69
use notification:: { Notifications , Notification } ;
69
70
use params:: { ConnectParams , IntoConnectParams , UserInfo } ;
70
71
use priv_io:: MessageStream ;
@@ -288,8 +289,8 @@ impl InnerConnection {
288
289
loop {
289
290
match try!( conn. read_message ( ) ) {
290
291
Backend :: BackendKeyData { process_id, secret_key } => {
291
- conn. cancel_data . process_id = process_id as i32 ;
292
- conn. cancel_data . secret_key = secret_key as i32 ;
292
+ conn. cancel_data . process_id = process_id;
293
+ conn. cancel_data . secret_key = secret_key;
293
294
}
294
295
Backend :: ReadyForQuery { .. } => break ,
295
296
Backend :: ErrorResponse { fields } => return DbError :: new_connect ( fields) ,
@@ -303,7 +304,7 @@ impl InnerConnection {
303
304
fn read_message_with_notification ( & mut self ) -> std_io:: Result < Backend > {
304
305
debug_assert ! ( !self . desynchronized) ;
305
306
loop {
306
- match try_desync ! ( self , ReadMessage :: read_message ( & mut self . stream) ) {
307
+ match try_desync ! ( self , self . stream. read_message ( ) ) {
307
308
Backend :: NoticeResponse { fields } => {
308
309
if let Ok ( err) = DbError :: new_raw ( fields) {
309
310
self . notice_handler . handle_notice ( err) ;
@@ -357,9 +358,9 @@ impl InnerConnection {
357
358
fn read_message ( & mut self ) -> std_io:: Result < Backend > {
358
359
loop {
359
360
match try!( self . read_message_with_notification ( ) ) {
360
- Backend :: NotificationResponse { pid , channel, payload } => {
361
+ Backend :: NotificationResponse { process_id , channel, payload } => {
361
362
self . notifications . push_back ( Notification {
362
- pid : pid ,
363
+ process_id : process_id ,
363
364
channel : channel,
364
365
payload : payload,
365
366
} )
0 commit comments