summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-01-25 12:17:07 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-01-25 12:17:07 +0000
commit11f3c51e8ffbff9563f902f4d653e230a3449e57 (patch)
tree713825fc94119e7ab0c1aec09e5916ad206d88e3
parent1a329b98a34c34f46c62a7d4d3d12eb25a313452 (diff)
downloadgnurl-11f3c51e8ffbff9563f902f4d653e230a3449e57.tar.gz
gnurl-11f3c51e8ffbff9563f902f4d653e230a3449e57.tar.bz2
gnurl-11f3c51e8ffbff9563f902f4d653e230a3449e57.zip
Get get-ftp-response function is now using Curl_read() for reading from a
socket. Curl_ConnectHTTPProxyTunnel changed prototype.
-rw-r--r--lib/ftp.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 464e17f8b..e7c968a00 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -221,7 +221,7 @@ int Curl_GetFTPResponse(int sockfd, char *buf,
int *ftpcode)
{
int nread;
- int keepon=TRUE;
+ size_t keepon=TRUE;
char *ptr;
int timeout = 3600; /* in seconds */
struct timeval interval;
@@ -272,22 +272,17 @@ int Curl_GetFTPResponse(int sockfd, char *buf,
break;
case 0: /* timeout */
error = SELECT_TIMEOUT;
- infof(data, "Transfer aborted due to timeout\n");
failf(data, "Transfer aborted due to timeout");
break;
default:
-#ifdef USE_SSLEAY
- if (data->ssl.use) {
- keepon = SSL_read(data->ssl.handle, ptr, 1);
- }
- else {
-#endif
- keepon = sread(sockfd, ptr, 1);
-#ifdef USE_SSLEAY
- }
-#endif /* USE_SSLEAY */
-
- if ((*ptr == '\n') || (*ptr == '\r'))
+ /*
+ * This code previously didn't use the kerberos sec_read() code
+ * to read, but when we use Curl_read() it may do so. Do confirm
+ * that this is still ok and then remove this comment!
+ */
+ if(CURLE_OK != Curl_read(conn, sockfd, ptr, 1, &keepon))
+ keepon = FALSE;
+ else if ((*ptr == '\n') || (*ptr == '\r'))
keepon = FALSE;
}
if(keepon) {
@@ -372,7 +367,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
if (data->bits.tunnel_thru_httpproxy) {
/* We want "seamless" FTP operations through HTTP proxy tunnel */
- result = Curl_ConnectHTTPProxyTunnel(data, data->firstsocket,
+ result = Curl_ConnectHTTPProxyTunnel(conn, data->firstsocket,
data->hostname, data->remote_port);
if(CURLE_OK != result)
return result;
@@ -979,7 +974,7 @@ CURLcode _ftp(struct connectdata *conn)
if (data->bits.tunnel_thru_httpproxy) {
/* We want "seamless" FTP operations through HTTP proxy tunnel */
- result = Curl_ConnectHTTPProxyTunnel(data, data->secondarysocket,
+ result = Curl_ConnectHTTPProxyTunnel(conn, data->secondarysocket,
newhost, newport);
if(CURLE_OK != result)
return result;