- remove noNeon runtime switch, http through neon only.

- remove http put to be able to build against upstream neon.

CVS patchset: 7589
CVS date: 2004/11/19 17:26:22
This commit is contained in:
jbj 2004-11-19 17:26:22 +00:00
parent 41c3c4df68
commit aba69f4963
9 changed files with 43 additions and 204 deletions

View File

@ -31,6 +31,8 @@
- add --delsign to purge packages of digital signatures.
- neon used by default for http/https transport.
- upgrade to db-4.3.21 final internal.
- remove noNeon runtime switch, http through neon only.
- remove http put to be able to build against upstream neon.
4.3.2 -> 4.3.3:
- bump micro version.

View File

@ -85,9 +85,6 @@ extern int _rpmts_stats;
/*@unchecked@*/
extern int noLibio;
/*@unchecked@*/
extern int noNeon;
/*@=exportheadervar@*/
/*@unchecked@*/
@ -279,8 +276,6 @@ struct poptOption rpmcliAllPoptTable[] = {
{ "nolibio", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noLibio, 1,
N_("disable use of libio(3) API"), NULL},
#endif
{ "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
N_("disable use of libneon for HTTP"), NULL},
{ "nosignature", '\0', 0, 0, RPMCLI_POPT_NOSIGNATURE,
N_("don't verify package signature(s)"), NULL },

View File

@ -20,7 +20,7 @@ Name: rpm
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
Release: 0.3
Release: 0.4
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
License: GPL
@ -493,6 +493,10 @@ exit 0
%{__includedir}/popt.h
%changelog
* Fri Nov 19 2004 Jeff Johnson <jbj@jbj.org> 4.4-0.4
- remove noNeon runtime switch, http through neon only.
- remove http put to be able to build against upstream neon.
* Thu Nov 11 2004 Jeff Johnson <jbj@jbj.org> 4.4-0.3
- neon used by default for http/https transport.
- add --delsign to purge packages of digital signatures.

View File

@ -14,13 +14,6 @@
#include <neon/ne_basic.h>
#include <neon/ne_dates.h>
#include <neon/ne_locks.h>
#define NEONBLOWSCHUNKS
#ifndef NEONBLOWSCHUNKS
/* HACK: include ne_private.h to access sess->socket for now. */
#include "../neon/src/ne_private.h"
#endif
#include <neon/ne_props.h>
#include <neon/ne_request.h>
#include <neon/ne_socket.h>
@ -405,6 +398,7 @@ static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
return NULL;
}
#ifdef UNUSED
/*@null@*/
static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
/*@modifies res @*/
@ -418,6 +412,7 @@ static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
/*@=branchstate@*/
return NULL;
}
#endif
static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
/*@*/
@ -956,11 +951,15 @@ assert(ctrl->req != NULL);
davConnection, ctrl);
if (!strcmp(httpCmd, "PUT")) {
#ifdef NOTYET /* XXX HACK no wr_chunked until libneon supports */
ctrl->wr_chunked = 1;
ne_add_request_header(ctrl->req, "Transfer-Encoding", "chunked");
ne_set_request_chunked(ctrl->req, 1);
/* HACK: no retries if/when chunking. */
rc = davResp(u, ctrl, NULL);
#else
rc = FTPERR_SERVER_IO_ERROR;
#endif
} else {
/* HACK: possible Last-Modified: Tue, 02 Nov 2004 14:29:36 GMT */
/* HACK: possible ETag: "inode-size-mtime" */
@ -1065,23 +1064,13 @@ hexdump(buf, rc);
ssize_t davWrite(void * cookie, const char * buf, size_t count)
{
#ifdef NOTYET /* XXX HACK no wr_chunked until libneon supports */
FD_t fd = cookie;
ssize_t rc;
int xx;
#ifndef NEONBLOWSCHUNKS
ne_session * sess;
assert(fd->req != NULL);
sess = ne_get_session(fd->req);
assert(sess != NULL);
/* HACK: include ne_private.h to access sess->socket for now. */
xx = ne_sock_fullwrite(sess->socket, buf, count);
#else
assert(fd->req != NULL);
xx = ne_send_request_chunk(fd->req, buf, count);
#endif
/* HACK: stupid error impedence matching. */
rc = (xx == 0 ? count : -1);
@ -1094,6 +1083,10 @@ hexdump(buf, count);
#endif
return rc;
#else
errno = EIO; /* HACK */
return -1;
#endif
}
int davSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, int whence)

View File

@ -94,9 +94,6 @@ int noLibio = 0;
int noLibio = 1;
#endif
/*@unchecked@*/
int noNeon = 0;
#define TIMEOUT_SECS 60
/**
@ -398,22 +395,6 @@ static ssize_t fdWrite(void * cookie, const char * buf, size_t count)
if (fd->ndigests && count > 0) fdUpdateDigests(fd, buf, count);
#define NEONBLOWSCHUNKS
#ifdef NEONBLOWSCHUNKS
if (fd->req == NULL)
#endif
if (fd->wr_chunked) {
char chunksize[20]; /* HACK: big enough. */
sprintf(chunksize, "%x\r\n", (unsigned)count);
#ifndef NEONBLOWSCHUNKS
/* HACK: flimsy wiring for davWrite */
if (fd->req != NULL)
rc = davWrite(fd, chunksize, strlen(chunksize));
else
#endif
rc = write(fdno, chunksize, strlen(chunksize));
if (rc == -1) fd->syserrno = errno;
}
if (count == 0) return 0;
fdstat_enter(fd, FDSTAT_WRITE);
@ -426,23 +407,6 @@ static ssize_t fdWrite(void * cookie, const char * buf, size_t count)
/*@=boundsread@*/
fdstat_exit(fd, FDSTAT_WRITE, rc);
#ifdef NEONBLOWSCHUNKS
if (fd->req == NULL)
#endif
if (fd->wr_chunked) {
int ec;
/*@-boundsread@*/
#ifndef NEONBLOWSCHUNKS
/* HACK: flimsy wiring for davWrite */
if (fd->req != NULL)
ec = davWrite(fd, "\r\n", sizeof("\r\n")-1);
else
#endif
ec = write(fdno, "\r\n", sizeof("\r\n")-1);
/*@=boundsread@*/
if (ec == -1) fd->syserrno = errno;
}
DBGIO(fd, (stderr, "==>\tfdWrite(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd)));
return rc;
@ -1964,38 +1928,6 @@ int ufdClose( /*@only@*/ void * cookie)
/* XXX Why not (u->urltype == URL_IS_HTTPS) ??? */
if (u->scheme != NULL && !strncmp(u->scheme, "http", sizeof("http")-1))
{
if (fd->wr_chunked) {
int rc;
#ifdef NEONBLOWSCHUNKS
if (!noNeon) {
fd->wr_chunked = 0;
/* HACK: flimsy wiring for davWrite */
rc = ne_send_request_chunk(fd->req, (void *)NULL, (size_t)0);
rc = ne_finish_request(fd->req);
rc = davResp(u, fd, NULL);
} else
#endif
{
/* XXX HTTP PUT requires terminating 0 length chunk. */
(void) fdWrite(fd, NULL, 0);
fd->wr_chunked = 0;
/* XXX HTTP PUT requires terminating entity-header. */
if (_ftp_debug)
fprintf(stderr, "-> \r\n");
(void) fdWrite(fd, "\r\n", sizeof("\r\n")-1);
#ifndef NEONBLOWSCHUNKS
if (!noNeon) {
rc = ne_finish_request(fd->req);
rc = davResp(u, fd, NULL);
} else
#endif
rc = httpResp(u, fd, NULL);
}
if ((_ftp_debug || _rpmio_debug) && rc) /* HACK: PUT rc not returned to Fclose. */
fprintf(stderr, "*** ufdClose: httpResp rc %d errno(%d) %s\n", rc, fd->syserrno, strerror(fd->syserrno));
}
/*
* HTTP has 4 (or 5 if persistent malloc) refs on the fd:
* "persist ctrl" url.c:177
@ -2078,55 +2010,6 @@ exit:
}
/*@=nullstate@*/
/*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */
static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags,
/*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
/*@globals h_errno, internalState @*/
/*@modifies *uret, internalState @*/
{
urlinfo u = NULL;
FD_t fd = NULL;
#if 0 /* XXX makeTempFile() heartburn */
assert(!(flags & O_RDWR));
#endif
if (urlSplit(url, &u))
goto exit;
if (u->ctrl == NULL)
u->ctrl = fdNew("persist ctrl (httpOpen)");
if (u->ctrl->nrefs > 2 && u->data == NULL)
u->data = fdNew("persist data (httpOpen)");
if (u->ctrl->url == NULL)
fd = fdLink(u->ctrl, "grab ctrl (httpOpen persist ctrl)");
else if (u->data->url == NULL)
fd = fdLink(u->data, "grab ctrl (httpOpen persist data)");
else
fd = fdNew("grab ctrl (httpOpen)");
if (fd) {
fdSetIo(fd, ufdio);
fd->ftpFileDoneNeeded = 0;
fd->rd_timeoutsecs = httpTimeoutSecs;
fd->contentLength = fd->bytesRemain = -1;
fd->url = urlLink(u, "url (httpOpen)");
fd = fdLink(fd, "grab data (httpOpen)");
assert(u->urltype == URL_IS_HTTP);
fd->urlType = u->urltype;
}
exit:
/*@-boundswrite@*/
if (uret)
*uret = u;
/*@=boundswrite@*/
/*@-refcounttrans@*/
return fd;
/*@=refcounttrans@*/
}
/*@=nullstate@*/
static /*@null@*/ FD_t ufdOpen(const char * url, int flags, mode_t mode)
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
@ -2164,7 +2047,6 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo
break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon) {
fd = davOpen(url, flags, mode, &u);
if (fd == NULL || u == NULL)
break;
@ -2184,27 +2066,6 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo
fd->wr_chunked = ((!strcmp(cmd, "PUT"))
? fd->wr_chunked : 0);
}
} else {
fd = httpOpen(url, flags, mode, &u);
if (fd == NULL || u == NULL)
break;
cmd = ((flags & O_WRONLY)
? ((flags & O_APPEND) ? "PUT" :
((flags & O_CREAT) ? "PUT" : "PUT"))
: "GET");
u->openError = httpReq(fd, cmd, path);
if (u->openError < 0) {
/* XXX make sure that we can exit through ufdClose */
fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
fd = fdLink(fd, "error data (ufdOpen HTTP)");
} else {
fd->bytesRemain = ((!strcmp(cmd, "GET"))
? fd->contentLength : -1);
fd->wr_chunked = ((!strcmp(cmd, "PUT"))
? fd->wr_chunked : 0);
}
}
break;
case URL_IS_DASH:
assert(!(flags & O_RDWR));

View File

@ -20,11 +20,6 @@
/*@access FD_t @*/
/*@access urlinfo @*/
/*@-redecl@*/
/*@unchecked@*/
extern int noNeon;
/*@=redecl@*/
/**
* Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
* @param p memory to free
@ -98,9 +93,8 @@ int Mkdir (const char * path, mode_t mode)
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davMkdir(path, mode);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -126,10 +120,11 @@ int Chdir (const char * path)
case URL_IS_HTTPS:
case URL_IS_HTTP:
#ifdef NOTYET
if (!noNeon)
return davChdir(path);
#else
return -2;
#endif
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -154,9 +149,8 @@ int Rmdir (const char * path)
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davRmdir(path);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -185,9 +179,8 @@ int Rename (const char * oldpath, const char * newpath)
switch (oldut) {
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davRename(oldpath, newpath);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
case URL_IS_PATH:
case URL_IS_UNKNOWN:
@ -280,9 +273,8 @@ int Unlink(const char * path) {
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davUnlink(path);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -1282,9 +1274,8 @@ fprintf(stderr, "*** Stat(%s,%p)\n", path, st);
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davStat(path, st);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -1311,9 +1302,8 @@ fprintf(stderr, "*** Lstat(%s,%p)\n", path, st);
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davLstat(path, st);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -1339,10 +1329,11 @@ int Readlink(const char * path, char * buf, size_t bufsiz)
case URL_IS_HTTPS:
case URL_IS_HTTP:
#ifdef NOTYET
if (!noNeon)
return davReadlink(path, buf, bufsiz);
#else
return -2;
#endif
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/
@ -1441,12 +1432,6 @@ fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", pattern, (unsigned)flags, (void *)e
switch (ut) {
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (noNeon) { /* XXX WRONG WRONG WRONG */
flags &= ~GLOB_TILDE;
pattern = lpath;
break;
}
/*@fallthrough@*/
case URL_IS_FTP:
/*@-type@*/
pglob->gl_closedir = Closedir;
@ -1491,9 +1476,8 @@ fprintf(stderr, "*** Opendir(%s)\n", path);
/*@notreached@*/ break;
case URL_IS_HTTPS:
case URL_IS_HTTP:
if (!noNeon)
return davOpendir(path);
/*@fallthrough@*/ /* XXX WRONG WRONG WRONG */
/*@notreached@*/ break;
case URL_IS_PATH:
path = lpath;
/*@fallthrough@*/

View File

@ -9,7 +9,7 @@
static int _debug = 0;
extern int noNeon;
int noNeon;
#define HTTPSPATH "https://localhost/test.txt"
#define HTTPPATH "http://localhost/test.txt"

View File

@ -9,7 +9,7 @@
static int _debug = 0;
extern int noNeon;
int noNeon;
#define HTTPSPATH "https://localhost/rawhide/test/*.rpm"
#if 0

View File

@ -9,7 +9,7 @@
static int _debug = 0;
extern int noNeon;
int noNeon;
#define HTTPSPATH "https://localhost/rawhide/toad/tput.txt"
#define HTTPPATH "http://localhost/rawhide/toad/tput.txt"