RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 21-Mar-2009 15:21:04 Branch: HEAD Handle: 2009032114210300 Modified files: rpm CHANGES rpm/rpmio librpmio.vers rpmurl.h url.c Log: - yarn: wire up urlFini, eliminate XurlFree. Summary: Revision Changes Path 1.2855 +1 -0 rpm/CHANGES 2.99 +0 -1 rpm/rpmio/librpmio.vers 1.39 +2 -9 rpm/rpmio/rpmurl.h 1.68 +69 -81 rpm/rpmio/url.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2854 -r1.2855 CHANGES --- rpm/CHANGES 20 Mar 2009 21:24:49 -0000 1.2854 +++ rpm/CHANGES 21 Mar 2009 14:21:03 -0000 1.2855 @@ -1,5 +1,6 @@ 5.2a3 -> 5.2a4: + - jbj: yarn: wire up urlFini, eliminate XurlFree. - jbj: yarn: wire up fdFini, eliminate XfdFree. - jbj: url: fix: u->use clobbers the lock from the pool. - jbj: rpmds: fix: rpmdsDup needs to go through rpmdsGetPool() too. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/librpmio.vers ============================================================================ $ cvs diff -u -r2.98 -r2.99 librpmio.vers --- rpm/rpmio/librpmio.vers 20 Mar 2009 21:24:49 -0000 2.98 +++ rpm/rpmio/librpmio.vers 21 Mar 2009 14:21:03 -0000 2.99 @@ -503,7 +503,6 @@ xstrncasecmp; xstrtolocale; XfdNew; - XurlFree; XurlNew; xzdio; yarnAbort; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmurl.h ============================================================================ $ cvs diff -u -r1.38 -r1.39 rpmurl.h --- rpm/rpmio/rpmurl.h 20 Mar 2009 18:28:35 -0000 1.38 +++ rpm/rpmio/rpmurl.h 21 Mar 2009 14:21:03 -0000 1.39 @@ -140,7 +140,6 @@ #define RPMURL_DEBUG_IO 0x40000000 #define RPMURL_DEBUG_REFS 0x20000000 - /** * Create a URL control structure instance. * @param msg debugging identifier (unused) @@ -177,14 +176,8 @@ urlinfo urlFree( /*...@killref@*/ urlinfo u, const char * msg) /*...@globals fileSystem, internalState @*/ /*...@modifies u, fileSystem, internalState @*/; - -/** @todo Remove debugging entry from the ABI. */ -/*...@null@*/ -urlinfo XurlFree( /*...@killref@*/ urlinfo u, const char * msg, - const char * fn, unsigned ln) - /*...@globals fileSystem, internalState @*/ - /*...@modifies u, fileSystem, internalState @*/; -#define urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__) +#define urlFree(_u, _msg) \ + ((urlinfo)rpmioFreePoolItem((rpmioItem)(_u), _msg, __FILE__, __LINE__)) /** * Free cached URL control structures. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/url.c ============================================================================ $ cvs diff -u -r1.67 -r1.68 url.c --- rpm/rpmio/url.c 20 Mar 2009 21:24:49 -0000 1.67 +++ rpm/rpmio/url.c 21 Mar 2009 14:21:03 -0000 1.68 @@ -64,6 +64,73 @@ /*...@only@*/ /*...@null@*/ urlinfo *_url_cache = NULL; +static void urlFini(void * _u) + /*@ modifies *_u @*/ +{ + urlinfo u =_u; + int xx; + + if (u->ctrl) { +#ifndef NOTYET + void * fp = fdGetFp(u->ctrl); + if (fp) { + fdPush(u->ctrl, fpio, fp, -1); /* Push fpio onto stack */ + xx = Fclose(u->ctrl); + } else if (fdFileno(u->ctrl) >= 0) + xx = fdio->close(u->ctrl); +#else + xx = Fclose(u->ctrl); +#endif + +/*...@-usereleased@*/ + u->ctrl = (FD_t)rpmioFreePoolItem((rpmioItem)u->ctrl, "persist ctrl (urlFree)", __FILE__, __LINE__); + if (u->ctrl) + fprintf(stderr, _("warning: u %p ctrl %p nrefs != 0 (%s %s)\n"), + u, u->ctrl, (u->host ? u->host : ""), + (u->scheme ? u->scheme : "")); +/*...@=usereleased@*/ + } + if (u->data) { +#ifndef NOTYET + void * fp = fdGetFp(u->data); + if (fp) { + fdPush(u->data, fpio, fp, -1); /* Push fpio onto stack */ + xx = Fclose(u->data); + } else if (fdFileno(u->data) >= 0) + xx = fdio->close(u->data); +#else + xx = Fclose(u->ctrl); +#endif + +/*...@-usereleased@*/ + u->data = (FD_t)rpmioFreePoolItem((rpmioItem)u->data, "persist data (urlFree)", __FILE__, __LINE__); + if (u->data) + fprintf(stderr, _("warning: u %p data %p nrefs != 0 (%s %s)\n"), + u, u->data, (u->host ? u->host : ""), + (u->scheme ? u->scheme : "")); +/*...@=usereleased@*/ + } +#ifdef WITH_NEON + xx = davFree(u); +#endif + u->etag = _free(u->etag); + u->location = _free(u->location); + u->rop = _free(u->rop); + u->sop = _free(u->sop); + u->top = _free(u->top); + u->buf = _free(u->buf); + u->url = _free(u->url); + u->scheme = _free((void *)u->scheme); + u->user = _free((void *)u->user); + u->password = _free((void *)u->password); + u->host = _free((void *)u->host); + u->portstr = _free((void *)u->portstr); + u->query = _free(u->query); + u->fragment = _free(u->fragment); + u->proxyu = _free((void *)u->proxyu); + u->proxyh = _free((void *)u->proxyh); +} + /** */ /*...@unchecked@*/ @@ -79,7 +146,7 @@ if (_urlPool == NULL) { _urlPool = rpmioNewPool(" u", sizeof(*u), -1, _url_debug, - NULL, NULL, NULL); + NULL, NULL, urlFini); pool = _urlPool; } return (urlinfo) rpmioGetPool(pool, sizeof(*u)); @@ -88,9 +155,7 @@ urlinfo XurlNew(const char *msg, const char *fn, unsigned ln) { urlinfo u = urlGetPool(_urlPool); - if (u == NULL) /* XXX can't happen */ - return NULL; - memset(u, 0, sizeof(*u)); + u->proxyp = -1; u->port = -1; u->urltype = URL_IS_UNKNOWN; @@ -113,82 +178,6 @@ return (urlinfo) rpmioLinkPoolItem((rpmioItem)u, msg, fn, ln); } -urlinfo XurlFree(urlinfo u, const char *msg, const char *fn, unsigned ln) -{ - int xx; - - URLSANE(u); - yarnPossess(u->_item.use); -URLDBGREFS(0, (stderr, "--> url %p -- %ld %s at %s:%u\n", u, yarnPeekLock(u->_item.use), msg, fn, ln)); - if (yarnPeekLock(u->_item.use) <= 1L) { - if (u->ctrl) { -#ifndef NOTYET - void * fp = fdGetFp(u->ctrl); - if (fp) { - fdPush(u->ctrl, fpio, fp, -1); /* Push fpio onto stack */ - xx = Fclose(u->ctrl); - } else if (fdFileno(u->ctrl) >= 0) - xx = fdio->close(u->ctrl); -#else - xx = Fclose(u->ctrl); -#endif - -/*...@-usereleased@*/ - u->ctrl = rpmioFreePoolItem(u->ctrl, "persist ctrl (urlFree)", fn, ln); - if (u->ctrl) - fprintf(stderr, _("warning: u %p ctrl %p nrefs != 0 (%s %s)\n"), - u, u->ctrl, (u->host ? u->host : ""), - (u->scheme ? u->scheme : "")); -/*...@=usereleased@*/ - } - if (u->data) { -#ifndef NOTYET - void * fp = fdGetFp(u->data); - if (fp) { - fdPush(u->data, fpio, fp, -1); /* Push fpio onto stack */ - (void) Fclose(u->data); - } else if (fdFileno(u->data) >= 0) - xx = fdio->close(u->data); -#else - xx = Fclose(u->ctrl); -#endif - -/*...@-usereleased@*/ - u->data = rpmioFreePoolItem(u->data, "persist data (urlFree)", fn, ln); - if (u->data) - fprintf(stderr, _("warning: u %p data %p nrefs != 0 (%s %s)\n"), - u, u->data, (u->host ? u->host : ""), - (u->scheme ? u->scheme : "")); -/*...@=usereleased@*/ - } -#ifdef WITH_NEON - xx = davFree(u); -#endif - u->etag = _free(u->etag); - u->location = _free(u->location); - u->rop = _free(u->rop); - u->sop = _free(u->sop); - u->top = _free(u->top); - u->buf = _free(u->buf); - u->url = _free(u->url); - u->scheme = _free((void *)u->scheme); - u->user = _free((void *)u->user); - u->password = _free((void *)u->password); - u->host = _free((void *)u->host); - u->portstr = _free((void *)u->portstr); - u->query = _free(u->query); - u->fragment = _free(u->fragment); - u->proxyu = _free((void *)u->proxyu); - u->proxyh = _free((void *)u->proxyh); - u = (urlinfo) rpmioPutPool((rpmioItem)u); - return NULL; - } else { - yarnTwist(u->_item.use, BY, -1); - /*...@-refcounttrans -retal...@*/ return u; /*...@=refcounttrans =retal...@*/ - } - /*...@notreached@*/ -} - void urlFreeCache(void) { if (_url_cache) { @@ -448,7 +437,6 @@ /** * Copy a URL, adding extra byte for the pesky trailing '/'. - * */ static const char * urlStrdup(const char * url) /*...@*/ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org