Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of /srv/git/r/doldaconnect
[doldaconnect.git]
/
clients
/
test.c
diff --git
a/clients/test.c
b/clients/test.c
index
fdc46c2
..
34f0779
100644
(file)
--- a/
clients/test.c
+++ b/
clients/test.c
@@
-1,24
+1,33
@@
#include <stdio.h>
#include <stdlib.h>
#include <sys/poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/poll.h>
+#include <time.h>
+#include <sys/time.h>
#include <doldaconnect/uilib.h>
#include <doldaconnect/uimisc.h>
#include <doldaconnect/uilib.h>
#include <doldaconnect/uimisc.h>
+#include <doldaconnect/utils.h>
+
+int done;
+double btime;
void authcallback(int err, wchar_t *reason, void *data)
{
void authcallback(int err, wchar_t *reason, void *data)
{
+ printf("auth: %f\n", ntime() - btime);
printf("Logged in: %i\n", err);
printf("Logged in: %i\n", err);
+ exit(0);
+ dc_queuecmd(NULL, NULL, L"quit", NULL);
}
int main(int argc, char **argv)
{
}
int main(int argc, char **argv)
{
- int i;
struct pollfd pfd;
struct pollfd pfd;
- int fd
, done
;
+ int fd;
struct dc_response *resp;
struct dc_response *resp;
- struct dc_intresp *ires;
+ btime = ntime();
dc_init();
dc_init();
+ printf("init: %f\n", ntime() - btime);
fd = dc_connect(NULL);
done = 0;
while(!done)
fd = dc_connect(NULL);
done = 0;
while(!done)
@@
-40,12
+49,16
@@
int main(int argc, char **argv)
{
if(!wcscmp(resp->cmdname, L".connect"))
{
{
if(!wcscmp(resp->cmdname, L".connect"))
{
- printf("Connected\n");
- dc_loginasync(NULL, 1, NULL, authcallback, NULL);
+ printf("conn: %f\n", ntime() - btime);
+ printf("Connected: %i\n", resp->code);
+ if(resp->code == 201)
+ dc_loginasync(NULL, 1, NULL, authcallback, NULL);
}
dc_freeresp(resp);
}
}
}
dc_freeresp(resp);
}
}
+ printf("fini: %f\n", ntime() - btime);
dc_cleanup();
dc_cleanup();
+ printf("exit: %f\n", ntime() - btime);
return(0);
}
return(0);
}