1212#include "tarantool_network.h"
1313#include "tarantool_exception.h"
1414
15+ #include "utils.h"
16+
1517int __tarantool_authenticate (tarantool_connection * obj );
1618
1719double
@@ -466,8 +468,8 @@ static int64_t tarantool_step_recv(
466468 } else {
467469 tarantool_throw_exception (
468470 "Bad error field type. Expected"
469- " STRING, got %s" , op_to_string (
470- z_error_str ));
471+ " STRING, got %s" ,
472+ tutils_op_to_string ( z_error_str ));
471473 goto error ;
472474 }
473475 } else {
@@ -601,7 +603,8 @@ int convert_iterator(zval *iter, int all) {
601603 return Z_LVAL_P (iter );
602604 } else if (Z_TYPE_P (iter ) != IS_STRING ) {
603605 tarantool_throw_exception ("Bad iterator type, expected NULL/STR"
604- "ING/LONG, got %s" , op_to_string (iter ));
606+ "ING/LONG, got %s" ,
607+ tutils_op_to_string (iter ));
605608 }
606609 const char * iter_str = Z_STRVAL_P (iter );
607610 size_t iter_str_len = Z_STRLEN_P (iter );
@@ -660,7 +663,7 @@ int get_spaceno_by_name(tarantool_connection *obj, zval *name) {
660663 }
661664
662665 if (tarantool_schema_add_spaces (obj -> schema , resp .data , resp .data_len )) {
663- // fprintf (stderr, "%s ", php_base64_encode( resp.data, resp.data_len)->val );
666+ tutils_hexdump_base (stderr , "\n " , resp .data , resp .data_len );
664667 tarantool_throw_parsingexception ("schema (space)" );
665668 return FAILURE ;
666669 }
@@ -720,7 +723,7 @@ int get_indexno_by_name(tarantool_connection *obj, int space_no,
720723 }
721724
722725 if (tarantool_schema_add_indexes (obj -> schema , resp .data , resp .data_len )) {
723- // fprintf (stderr, "%s ", php_base64_encode( resp.data, resp.data_len)->val );
726+ tutils_hexdump_base (stderr , "\n " , resp .data , resp .data_len );
724727 tarantool_throw_parsingexception ("schema (index)" );
725728 return FAILURE ;
726729 }
@@ -775,7 +778,7 @@ int get_fieldno_by_name(tarantool_connection *obj, uint32_t space_no,
775778 }
776779
777780 if (tarantool_schema_add_spaces (obj -> schema , resp .data , resp .data_len )) {
778- // fprintf (stderr, "%s ", php_base64_encode( resp.data, resp.data_len)->val );
781+ tutils_hexdump_base (stderr , "\n " , resp .data , resp .data_len );
779782 tarantool_throw_parsingexception ("schema (space)" );
780783 return FAILURE ;
781784 }
@@ -859,7 +862,7 @@ int tarantool_uwrite_op(tarantool_connection *obj, zval *op, uint32_t pos,
859862 THROW_EXC ("Field ARG must be provided and must be LONG "
860863 "or DOUBLE for '%s' at position %d (got '%s')" ,
861864 Z_STRVAL_P (opstr ), pos ,
862- op_to_string (oparg ));
865+ tutils_op_to_string (oparg ));
863866 goto cleanup ;
864867 }
865868 php_tp_encode_uother (obj -> value , Z_STRVAL_P (opstr )[0 ],
@@ -876,7 +879,7 @@ int tarantool_uwrite_op(tarantool_connection *obj, zval *op, uint32_t pos,
876879 THROW_EXC ("Field ARG must be provided and must be LONG "
877880 "for '%s' at position %d (got '%s')" ,
878881 Z_STRVAL_P (opstr ), pos ,
879- op_to_string (oparg ));
882+ tutils_op_to_string (oparg ));
880883 goto cleanup ;
881884 }
882885 php_tp_encode_uother (obj -> value , Z_STRVAL_P (opstr )[0 ],
@@ -1221,15 +1224,15 @@ int __tarantool_authenticate(tarantool_connection *obj) {
12211224 if (tarantool_schema_add_spaces (obj -> schema , resp .data ,
12221225 resp .data_len ) &&
12231226 status != FAILURE ) {
1224- // fprintf (stderr, "%s ", php_base64_encode( resp.data, resp.data_len)->val );
1227+ tutils_hexdump_base (stderr , "\n " , resp .data , resp .data_len );
12251228 tarantool_throw_parsingexception ("schema (space)" );
12261229 status = FAILURE ;
12271230 }
12281231 } else if (resp .sync == index_sync ) {
12291232 if (tarantool_schema_add_indexes (obj -> schema , resp .data ,
12301233 resp .data_len ) &&
12311234 status != FAILURE ) {
1232- // fprintf (stderr, "%s ", php_base64_encode( resp.data, resp.data_len)->val );
1235+ tutils_hexdump_base (stderr , "\n " , resp .data , resp .data_len );
12331236 tarantool_throw_parsingexception ("schema (index)" );
12341237 status = FAILURE ;
12351238 }
0 commit comments