summaryrefslogtreecommitdiffstats
path: root/tests/test_client.c
diff options
context:
space:
mode:
authorAnton <anton@picapica>2015-03-16 23:56:02 +0400
committerAnton <anton@picapica>2015-03-16 23:56:02 +0400
commita32462dd698ebf58615a5fed3af5b50c28df9fce (patch)
tree859369be53009644bfa995509043938e388f3252 /tests/test_client.c
parenta3b23291f5c50b423faa4d3c3ae88889be02d6cb (diff)
downloadpica-pica-a32462dd698ebf58615a5fed3af5b50c28df9fce.tar.gz
pica-pica-a32462dd698ebf58615a5fed3af5b50c28df9fce.zip
updated test client
Diffstat (limited to 'tests/test_client.c')
-rwxr-xr-xtests/test_client.c13
1 files changed, 11 insertions, 2 deletions
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)
{