X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=clients%2Fgtk2%2Fmain.c;fp=clients%2Fgtk2%2Fmain.c;h=aebeaacdb371814fe95de2250eca0269ddf7a44c;hb=5e1e52f14fabed501d62d56fecc0b91d972e5673;hp=643d9757017866394d3bd14c96c89fea8a2bee4a;hpb=9cbeb60c78389bde5a290e263335cffffbb5ced6;p=doldaconnect.git diff --git a/clients/gtk2/main.c b/clients/gtk2/main.c index 643d975..aebeaac 100644 --- a/clients/gtk2/main.c +++ b/clients/gtk2/main.c @@ -1067,16 +1067,20 @@ void handleresps(void) { if(!wcscmp(resp->cmdname, L".connect")) { - if(resp->code == 200) + if(resp->code != 201) { + msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("The server refused the connection")); + dc_disconnect(); + dcdisconnected(); + } else if(dc_checkprotocol(resp, DC_LATEST)) { + msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Server protocol revision mismatch")); + dc_disconnect(); + dcdisconnected(); + } else { tosbuf = 0x10; /* Minimum cost */ setsockopt(dcfd, SOL_IP, IP_TOS, &tosbuf, sizeof(tosbuf)); updatesbar(_("Connected")); dc_loginasync(connectas, 1, loginconv, logincallback, NULL); - } else { - msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("The server refused the connection")); - dc_disconnect(); - dcdisconnected(); } } else if(!wcscmp(resp->cmdname, L".notify")) { dc_uimisc_handlenotify(resp);