X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=clients%2Ftest.c;h=04f471c0935b0d35174ff04ea6729c03b2367f33;hb=e5c8b0ca6215e635b774a5a4e60181e38c33480b;hp=46bd2f7f038e3583256d92e6f7464babe90baa5d;hpb=118ce98812409db434e2f87220aaf3b286e0c549;p=doldaconnect.git diff --git a/clients/test.c b/clients/test.c index 46bd2f7..04f471c 100644 --- a/clients/test.c +++ b/clients/test.c @@ -12,11 +12,9 @@ void authcallback(int err, wchar_t *reason, void *data) int main(int argc, char **argv) { - int i; struct pollfd pfd; int fd, done; struct dc_response *resp; - struct dc_intresp *ires; dc_init(); fd = dc_connect(NULL); @@ -38,10 +36,11 @@ int main(int argc, char **argv) done = 1; while((resp = dc_getresp()) != NULL) { - if(!strcmp(resp->cmdname, ".connect")) + if(!wcscmp(resp->cmdname, L".connect")) { - printf("Connected\n"); - dc_loginasync(NULL, 1, NULL, authcallback, NULL); + printf("Connected: %i\n", resp->code); + if(resp->code == 201) + dc_loginasync(NULL, 1, NULL, authcallback, NULL); } dc_freeresp(resp); }