curl_socket_t mistakes cleanup

This commit is contained in:
Daniel Stenberg 2004-03-10 16:01:47 +00:00
parent 85838a8966
commit 7225b14002
7 changed files with 18 additions and 14 deletions

View File

@ -750,7 +750,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
fd_set readfd;
char *line_start;
char *host_port;
int tunnelsocket = conn->sock[sockindex];
curl_socket_t tunnelsocket = conn->sock[sockindex];
#define SELECT_OK 0
#define SELECT_ERROR 1

View File

@ -279,8 +279,8 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
FD_SET(sockfd, write_fd_set);
}
if(sockfd > *max_fd)
*max_fd = sockfd;
if((int)sockfd > *max_fd)
*max_fd = (int)sockfd;
}
break;
case CURLM_STATE_PERFORM:

View File

@ -23,7 +23,8 @@
* $Id$
***************************************************************************/
CURLcode Curl_sendf(int fd, struct connectdata *, const char *fmt, ...);
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
const char *fmt, ...);
void Curl_infof(struct SessionHandle *, const char *fmt, ...);
void Curl_failf(struct SessionHandle *, const char *fmt, ...);
@ -42,7 +43,8 @@ int Curl_read(struct connectdata *conn, curl_socket_t sockfd,
char *buf, size_t buffersize,
ssize_t *n);
/* internal write-function, does plain socket, SSL and krb4 */
CURLcode Curl_write(struct connectdata *conn, int sockfd,
CURLcode Curl_write(struct connectdata *conn,
curl_socket_t sockfd,
void *mem, size_t len,
ssize_t *written);

View File

@ -23,7 +23,7 @@
* $Id$
***************************************************************************/
#include "urldata.h"
CURLcode Curl_SSLConnect(struct connectdata *conn, curl_socket_t sockfd);
CURLcode Curl_SSLConnect(struct connectdata *conn, int sockindex);
void Curl_SSL_init(void); /* Global SSL init */
void Curl_SSL_cleanup(void); /* Global SSL cleanup */

View File

@ -1368,7 +1368,10 @@ void Curl_single_fdset(struct connectdata *conn,
}
if(conn->keep.keepon & KEEP_WRITE) {
FD_SET(conn->writesockfd, write_fd_set);
if(conn->writesockfd > *max_fd)
/* since sockets are curl_socket_t nowadays, we typecast it to int here
to compare it nicely */
if((int)conn->writesockfd > *max_fd)
*max_fd = conn->writesockfd;
conn->keep.writefdp = write_fd_set; /* store the address of the set */
}

View File

@ -37,14 +37,13 @@ CURLcode Curl_readwrite_init(struct connectdata *conn);
/* This sets up a forthcoming transfer */
CURLcode
Curl_Transfer (struct connectdata *data,
curl_socket_t sockfd, /* socket to read from or
CURL_SOCKET_BAD */
int sockindex, /* socket index to read from or -1 */
curl_off_t size, /* -1 if unknown at this point */
bool getheader, /* TRUE if header parsing is wanted */
curl_off_t *bytecountp, /* return number of bytes read */
curl_socket_t writesockfd, /* socket to write to, it may very
well be the same we read from.
CURL_SOCKET_BAD disables */
int writesockindex, /* socket index to write to, it may
very well be the same we read from.
-1 disables */
curl_off_t *writecountp /* return number of bytes written */
);
#endif

View File

@ -1378,7 +1378,7 @@ CURLcode Curl_disconnect(struct connectdata *conn)
* be dead. Most commonly this happens when the server has closed the
* connection due to inactivity.
*/
static bool SocketIsDead(int sock)
static bool SocketIsDead(curl_socket_t sock)
{
int sval;
bool ret_val = TRUE;
@ -1386,7 +1386,7 @@ static bool SocketIsDead(int sock)
struct timeval to;
FD_ZERO(&check_set);
FD_SET(sock,&check_set);
FD_SET(sock, &check_set);
to.tv_sec = 0;
to.tv_usec = 0;