X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Furl.c;h=3c2b361b75a3d31c6bd8cf1be6a2415178b68413;hb=dbc40ad16aa82379d2884e106d79c7d83312667a;hp=7bf6f4eed7d52c7b864e6a63537fc09e48e0d4b3;hpb=08921de88f9edf4a9ac2cb440af8ee4b009dc8fe;p=yaz-moved-to-github.git diff --git a/src/url.c b/src/url.c index 7bf6f4e..3c2b361 100644 --- a/src/url.c +++ b/src/url.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. */ /** @@ -60,7 +60,7 @@ static void extract_user_pass(NMEM nmem, if (cp1 && cp1 > uri) { cp1--; - + if (!strncmp(cp1, "://", 3)) { const char *cp3 = 0; @@ -76,7 +76,7 @@ static void extract_user_pass(NMEM nmem, *uri_lean = nmem_malloc(nmem, strlen(uri) + 1); memcpy(*uri_lean, uri, cp1 + 3 - uri); strcpy(*uri_lean + (cp1 + 3 - uri), cp2 + 1); - + *http_user = nmem_strdupn(nmem, cp1 + 3, cp3 - (cp1 + 3)); *http_pass = nmem_strdupn(nmem, cp3 + 1, cp2 - (cp3 + 1)); } @@ -146,7 +146,7 @@ Z_HTTP_Response *yaz_url_exec(yaz_url_t p, const char *uri, { int len; char *buf = odr_getbuf(p->odr_out, &len, 0); - + if (cs_put(conn, buf, len) < 0) yaz_log(YLOG_WARN, "cs_put failed URL: %s", uri); else