X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=clients%2Ftest.c;h=34f0779e5fc5924cba1acbcdb7bbf580577cb28d;hb=d6932520155665f13a3af7ab40ca6a724328d09f;hp=f5e6cbd1c181c97923886f1ecb12a06615f41e5c;hpb=97ca763e1e3feafd069ecb75277c0e5425aa1f72;p=doldaconnect.git diff --git a/clients/test.c b/clients/test.c index f5e6cbd..34f0779 100644 --- a/clients/test.c +++ b/clients/test.c @@ -1,22 +1,33 @@ #include #include #include +#include +#include #include #include +#include + +int done; +double btime; void authcallback(int err, wchar_t *reason, void *data) { + printf("auth: %f\n", ntime() - btime); printf("Logged in: %i\n", err); + exit(0); + dc_queuecmd(NULL, NULL, L"quit", NULL); } int main(int argc, char **argv) { struct pollfd pfd; - int fd, done; + int fd; struct dc_response *resp; + btime = ntime(); dc_init(); + printf("init: %f\n", ntime() - btime); fd = dc_connect(NULL); done = 0; while(!done) @@ -38,13 +49,16 @@ int main(int argc, char **argv) { if(!wcscmp(resp->cmdname, L".connect")) { + printf("conn: %f\n", ntime() - btime); printf("Connected: %i\n", resp->code); - if(resp->code == 200) + if(resp->code == 201) dc_loginasync(NULL, 1, NULL, authcallback, NULL); } dc_freeresp(resp); } } + printf("fini: %f\n", ntime() - btime); dc_cleanup(); + printf("exit: %f\n", ntime() - btime); return(0); }