X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=09c9a85ce36479404f27caa27e2e4aa137eeaca4;hb=77f27a99f17bdd5e6fc4d8a202ecc6da4ef95660;hp=cb783b2a19dee9936adf565d8c91a4f099bbbf7b;hpb=ffe862e36b8b60b1197b223cec0b78482cbd7763;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index cb783b2..09c9a85 100644 --- a/client/client.c +++ b/client/client.c @@ -1200,6 +1200,25 @@ static int send_srw(Z_SRW_PDU *sr) gdu = z_get_HTTP_Request_host_path(out, host_port, path); + if (auth) + { + if (auth->which == Z_IdAuthentication_open) + { + char **darray; + int num; + nmem_strsplit(out->mem, "/", auth->u.open, &darray, &num); + if (num >= 1) + sr->username = darray[0]; + if (num >= 2) + sr->password = darray[1]; + } + else if (auth->which == Z_IdAuthentication_idPass) + { + sr->username = auth->u.idPass->userId; + sr->password = auth->u.idPass->password; + } + } + if (!yaz_matchstr(sru_method, "get")) { yaz_sru_get_encode(gdu->u.HTTP_Request, sr, out, charset); @@ -4965,7 +4984,10 @@ static void client(void) { line_in=readline(C_PROMPT); if (!line_in) + { + putchar('\n'); break; + } #if HAVE_READLINE_HISTORY_H if (*line_in) add_history(line_in);