From a32462dd698ebf58615a5fed3af5b50c28df9fce Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 16 Mar 2015 23:56:02 +0400 Subject: updated test client --- PICA_client.c | 2 +- tests/test_client | Bin 35075 -> 0 bytes tests/test_client.c | 13 +++++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) delete mode 100755 tests/test_client diff --git a/PICA_client.c b/PICA_client.c index 4b6f3a9..0f6460d 100755 --- a/PICA_client.c +++ b/PICA_client.c @@ -1257,7 +1257,7 @@ else } } -cid->state = PICA_CONNSTATE_WAITINGREP; +//cid->state = PICA_CONNSTATE_WAITINGREP; do { diff --git a/tests/test_client b/tests/test_client deleted file mode 100755 index a384dee..0000000 Binary files a/tests/test_client and /dev/null differ diff --git a/tests/test_client.c b/tests/test_client.c index 9ea2de2..a94951c 100755 --- a/tests/test_client.c +++ b/tests/test_client.c @@ -6,6 +6,7 @@ struct sockaddr_in a; +struct PICA_acc *acc; struct PICA_c2n *c; struct PICA_c2c *chn; @@ -121,11 +122,19 @@ PICA_client_init(&cbs); // a.sin_addr.s_addr = inet_addr (argv[1]);//("127.0.0.1"); // a.sin_port = htons(51914); +printf("opening account..."); +ret = PICA_open_acc(argv[3], argv[3],argv[3], NULL, &acc); + +if (ret != PICA_OK) +{ + printf("failed to open account, ret = %i\n", ret); + return 1; +} printf("making connection...\n"); //PICA_new_connection(const char *nodeaddr, unsigned int port, const char *CA_file, const char *cert_file, const char *pkey_file, const char* password, struct PICA_c2n **ci) -ret=PICA_new_connection(argv[1], atoi(argv[2]), /*"trusted_CA.pem"*/ argv[3], argv[3],argv[3],NULL,&c); +ret=PICA_new_connection(acc, argv[1], atoi(argv[2]), /*"trusted_CA.pem"*/ &c); ERR_print_errors_fp(stdout); @@ -147,7 +156,7 @@ if (argc==5) printf("Creating channel to %s...\n",PICA_id_to_base64(peer_id, NULL)); - ret=PICA_create_channel(c,peer_id,&chn); + ret=PICA_create_channel(c,peer_id,NULL,&chn); //sleep(17);//timeout test if (ret!=PICA_OK) { -- cgit v1.2.1