diff options
author | adevries <devnull@localhost> | 1999-02-04 18:48:03 +0000 |
---|---|---|
committer | adevries <devnull@localhost> | 1999-02-04 18:48:03 +0000 |
commit | a7366495ae19850d0cc996cae867ac5b59b250af (patch) | |
tree | 7f308692a525c362accf7570614aba13cb199c44 /ftp.c | |
parent | 0166b45137233b4e51b0062633b13962a6af0715 (diff) | |
download | rpm-a7366495ae19850d0cc996cae867ac5b59b250af.tar.gz rpm-a7366495ae19850d0cc996cae867ac5b59b250af.tar.bz2 rpm-a7366495ae19850d0cc996cae867ac5b59b250af.zip |
Finally, preliminary http support.
- Alex
CVS patchset: 2773
CVS date: 1999/02/04 18:48:03
Diffstat (limited to 'ftp.c')
-rw-r--r-- | ftp.c | 38 |
1 files changed, 1 insertions, 37 deletions
@@ -218,7 +218,7 @@ static int getHostAddress(const char * host, struct in_addr * address) { return 0; } -static int tcpConnect(const char *host, int port) +int tcpConnect(const char *host, int port) { struct sockaddr_in sin; int sock = -1; @@ -254,38 +254,6 @@ fprintf(stderr,"++ connect %s:%d on fd %d\n", inet_ntoa(sin.sin_addr), ntohs(sin return sock; } -int httpOpen(urlinfo *u) -{ - int sock; - const char *host; - int port; - char *buf; - size_t len; - - if (u == NULL || ((host = u->host) == NULL)) - return FTPERR_BAD_HOSTNAME; - - if ((port = u->port) < 0) port = 80; - - if ((sock = tcpConnect(host, port)) < 0) - return sock; - - len = strlen(u->path) + sizeof("GET \r\n"); - buf = alloca(len); - strcpy(buf, "GET "); - strcat(buf, u->path); - strcat(buf, "\r\n"); - - if (write(sock, buf, len) != len) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - -if (ftpDebug) -fprintf(stderr, "-> %s", buf); - return sock; -} - int ftpOpen(urlinfo *u) { const char * host; @@ -529,10 +497,6 @@ fprintf(stderr, "-> %s", retrCommand); return 0; } -int httpGetFile(FD_t sfd, FD_t tfd) { - return copyData(sfd, tfd); -} - int ftpGetFile(FD_t sfd, FD_t tfd) { urlinfo *u; |