@@ -274,7 +274,7 @@ impl InnerConnection {
274
274
}
275
275
276
276
let options = options. iter ( ) . map ( |& ( ref a, ref b) | ( & * * a, & * * b) ) ;
277
- try!( conn. stream . write_message2 ( |buf| frontend:: startup_message ( options, buf) ) ) ;
277
+ try!( conn. stream . write_message ( |buf| frontend:: startup_message ( options, buf) ) ) ;
278
278
try!( conn. stream . flush ( ) ) ;
279
279
280
280
try!( conn. handle_auth ( user) ) ;
@@ -370,15 +370,15 @@ impl InnerConnection {
370
370
let pass = try!( user. password . ok_or_else ( || {
371
371
ConnectError :: ConnectParams ( "a password was requested but not provided" . into ( ) )
372
372
} ) ) ;
373
- try!( self . stream . write_message2 ( |buf| frontend:: password_message ( & pass, buf) ) ) ;
373
+ try!( self . stream . write_message ( |buf| frontend:: password_message ( & pass, buf) ) ) ;
374
374
try!( self . stream . flush ( ) ) ;
375
375
}
376
376
backend:: Message :: AuthenticationMD5Password { salt } => {
377
377
let pass = try!( user. password . ok_or_else ( || {
378
378
ConnectError :: ConnectParams ( "a password was requested but not provided" . into ( ) )
379
379
} ) ) ;
380
380
let output = authentication:: md5_hash ( user. user . as_bytes ( ) , pass. as_bytes ( ) , salt) ;
381
- try!( self . stream . write_message2 ( |buf| frontend:: password_message ( & output, buf) ) ) ;
381
+ try!( self . stream . write_message ( |buf| frontend:: password_message ( & output, buf) ) ) ;
382
382
try!( self . stream . flush ( ) ) ;
383
383
}
384
384
backend:: Message :: AuthenticationKerberosV5 |
@@ -406,9 +406,9 @@ impl InnerConnection {
406
406
fn raw_prepare ( & mut self , stmt_name : & str , query : & str ) -> Result < ( Vec < Type > , Vec < Column > ) > {
407
407
debug ! ( "preparing query with name `{}`: {}" , stmt_name, query) ;
408
408
409
- try!( self . stream . write_message2 ( |buf| frontend:: parse ( stmt_name, query, None , buf) ) ) ;
410
- try!( self . stream . write_message2 ( |buf| frontend:: describe ( b'S' , stmt_name, buf) ) ) ;
411
- try!( self . stream . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
409
+ try!( self . stream . write_message ( |buf| frontend:: parse ( stmt_name, query, None , buf) ) ) ;
410
+ try!( self . stream . write_message ( |buf| frontend:: describe ( b'S' , stmt_name, buf) ) ) ;
411
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
412
412
try!( self . stream . flush ( ) ) ;
413
413
414
414
match try!( self . read_message ( ) ) {
@@ -465,11 +465,11 @@ impl InnerConnection {
465
465
return DbError :: new ( fields) ;
466
466
}
467
467
backend:: Message :: CopyInResponse { .. } => {
468
- try!( self . stream . write_message2 ( |buf| {
468
+ try!( self . stream . write_message ( |buf| {
469
469
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
470
470
} ) ) ;
471
471
try!( self . stream
472
- . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
472
+ . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
473
473
try!( self . stream . flush ( ) ) ;
474
474
}
475
475
backend:: Message :: CopyOutResponse { .. } => {
@@ -509,7 +509,7 @@ impl InnerConnection {
509
509
510
510
{
511
511
let info = SessionInfo :: new ( & self . parameters ) ;
512
- let r = self . stream . write_message2 ( |buf| {
512
+ let r = self . stream . write_message ( |buf| {
513
513
frontend:: bind ( portal_name,
514
514
& stmt_name,
515
515
Some ( 1 ) ,
@@ -531,8 +531,8 @@ impl InnerConnection {
531
531
}
532
532
}
533
533
534
- try!( self . stream . write_message2 ( |buf| frontend:: execute ( portal_name, row_limit, buf) ) ) ;
535
- try!( self . stream . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
534
+ try!( self . stream . write_message ( |buf| frontend:: execute ( portal_name, row_limit, buf) ) ) ;
535
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
536
536
try!( self . stream . flush ( ) ) ;
537
537
538
538
match try!( self . read_message ( ) ) {
@@ -587,8 +587,8 @@ impl InnerConnection {
587
587
}
588
588
589
589
fn close_statement ( & mut self , name : & str , type_ : u8 ) -> Result < ( ) > {
590
- try!( self . stream . write_message2 ( |buf| frontend:: close ( type_, name, buf) ) ) ;
591
- try!( self . stream . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
590
+ try!( self . stream . write_message ( |buf| frontend:: close ( type_, name, buf) ) ) ;
591
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
592
592
try!( self . stream . flush ( ) ) ;
593
593
let resp = match try!( self . read_message ( ) ) {
594
594
backend:: Message :: CloseComplete => Ok ( ( ) ) ,
@@ -798,7 +798,7 @@ impl InnerConnection {
798
798
fn quick_query ( & mut self , query : & str ) -> Result < Vec < Vec < Option < String > > > > {
799
799
check_desync ! ( self ) ;
800
800
debug ! ( "executing query: {}" , query) ;
801
- try!( self . stream . write_message2 ( |buf| frontend:: query ( query, buf) ) ) ;
801
+ try!( self . stream . write_message ( |buf| frontend:: query ( query, buf) ) ) ;
802
802
try!( self . stream . flush ( ) ) ;
803
803
804
804
let mut result = vec ! [ ] ;
@@ -811,11 +811,11 @@ impl InnerConnection {
811
811
. collect ( ) ) ;
812
812
}
813
813
backend:: Message :: CopyInResponse { .. } => {
814
- try!( self . stream . write_message2 ( |buf| {
814
+ try!( self . stream . write_message ( |buf| {
815
815
frontend:: copy_fail ( "COPY queries cannot be directly executed" , buf)
816
816
} ) ) ;
817
817
try!( self . stream
818
- . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
818
+ . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: sync ( buf) ) ) ) ;
819
819
try!( self . stream . flush ( ) ) ;
820
820
}
821
821
backend:: Message :: ErrorResponse { fields } => {
@@ -830,7 +830,7 @@ impl InnerConnection {
830
830
831
831
fn finish_inner ( & mut self ) -> Result < ( ) > {
832
832
check_desync ! ( self ) ;
833
- try!( self . stream . write_message2 ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: terminate ( buf) ) ) ) ;
833
+ try!( self . stream . write_message ( |buf| Ok :: < ( ) , std_io:: Error > ( frontend:: terminate ( buf) ) ) ) ;
834
834
try!( self . stream . flush ( ) ) ;
835
835
Ok ( ( ) )
836
836
}
0 commit comments