mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Dan Torop cleaned up a few no longer used variables from David Phillips'
select() overhaul fix.
This commit is contained in:
parent
38f8087281
commit
c5b2e85b47
3
CHANGES
3
CHANGES
@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
|
|
||||||
Daniel (11 January 2005)
|
Daniel (11 January 2005)
|
||||||
|
- Dan Torop cleaned up a few no longer used variables from David Phillips'
|
||||||
|
select() overhaul fix.
|
||||||
|
|
||||||
- Cyrill Osterwalder posted a detailed analysis about a bug that occurs when
|
- Cyrill Osterwalder posted a detailed analysis about a bug that occurs when
|
||||||
using a custom Host: header and curl fails to send a request on a re-used
|
using a custom Host: header and curl fails to send a request on a re-used
|
||||||
persistent connection and thus creates a new connection and resends it. It
|
persistent connection and thus creates a new connection and resends it. It
|
||||||
|
@ -36,6 +36,6 @@ advice from friends like these:
|
|||||||
|
|
||||||
Dan Fandrich, Peter Pentchev, Marcin Konicki, Rune Kleveland, David Shaw,
|
Dan Fandrich, Peter Pentchev, Marcin Konicki, Rune Kleveland, David Shaw,
|
||||||
Werner Koch, Gisle Vanem, Alex Neblett, Kai Sommerfeld, Marty Kuhrt,
|
Werner Koch, Gisle Vanem, Alex Neblett, Kai Sommerfeld, Marty Kuhrt,
|
||||||
Hzhijun, Pavel Orehov, Bruce Mitchener, Cyrill Osterwalder
|
Hzhijun, Pavel Orehov, Bruce Mitchener, Cyrill Osterwalder, Dan Torop
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
@ -16,13 +16,9 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This function extracts file descriptor information from a given multi_handle.
|
This function extracts file descriptor information from a given multi_handle.
|
||||||
libcurl returns its fd_set sets. The application can use these to select()
|
libcurl returns its fd_set sets. The application can use these to select()
|
||||||
on. The \fIcurl_multi_perform(3)\fI function should be called as soon as one
|
on. The \fIcurl_multi_perform(3)\fP function should be called as soon as one
|
||||||
of them are ready to be read from or written to.
|
of them are ready to be read from or written to.
|
||||||
|
|
||||||
NOTE that once this call is made, you must not remove the sets you point to,
|
|
||||||
as libcurl will need to be able to read them. It needs them after select()
|
|
||||||
calls, to know if certain sockets are readable or writable.
|
|
||||||
|
|
||||||
You should also be aware that when doing select(), you should consider using a
|
You should also be aware that when doing select(), you should consider using a
|
||||||
rather small (single-digit number of seconds) timeout and call
|
rather small (single-digit number of seconds) timeout and call
|
||||||
\fIcurl_multi_perform\fP regularly - even if no activity has been seen on the
|
\fIcurl_multi_perform\fP regularly - even if no activity has been seen on the
|
||||||
|
@ -464,7 +464,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
|
|
||||||
k->write_after_100_header = FALSE;
|
k->write_after_100_header = FALSE;
|
||||||
k->keepon |= KEEP_WRITE;
|
k->keepon |= KEEP_WRITE;
|
||||||
k->wkeepfd = k->writefd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1192,7 +1191,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
go into the Expect: 100 state and await such a header */
|
go into the Expect: 100 state and await such a header */
|
||||||
k->wait100_after_headers = FALSE; /* headers sent */
|
k->wait100_after_headers = FALSE; /* headers sent */
|
||||||
k->write_after_100_header = TRUE; /* wait for the header */
|
k->write_after_100_header = TRUE; /* wait for the header */
|
||||||
k->wkeepfd = k->writefd; /* set the keeper variable */
|
|
||||||
k->keepon &= ~KEEP_WRITE; /* disable writing */
|
k->keepon &= ~KEEP_WRITE; /* disable writing */
|
||||||
k->start100 = Curl_tvnow(); /* timeout count starts now */
|
k->start100 = Curl_tvnow(); /* timeout count starts now */
|
||||||
didwhat &= ~KEEP_WRITE; /* we didn't write anything actually */
|
didwhat &= ~KEEP_WRITE; /* we didn't write anything actually */
|
||||||
@ -1336,7 +1334,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
/* we've waited long enough, continue anyway */
|
/* we've waited long enough, continue anyway */
|
||||||
k->write_after_100_header = FALSE;
|
k->write_after_100_header = FALSE;
|
||||||
k->keepon |= KEEP_WRITE;
|
k->keepon |= KEEP_WRITE;
|
||||||
k->wkeepfd = k->writefd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1463,12 +1460,6 @@ CURLcode Curl_readwrite_init(struct connectdata *conn)
|
|||||||
k->keepon |= KEEP_WRITE;
|
k->keepon |= KEEP_WRITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get these in backup variables to be able to restore them on each lap in
|
|
||||||
the select() loop */
|
|
||||||
k->rkeepfd = k->readfd;
|
|
||||||
k->wkeepfd = k->writefd;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
@ -1491,7 +1482,6 @@ void Curl_single_fdset(struct connectdata *conn,
|
|||||||
if(conn->keep.keepon & KEEP_READ) {
|
if(conn->keep.keepon & KEEP_READ) {
|
||||||
FD_SET(conn->sockfd, read_fd_set);
|
FD_SET(conn->sockfd, read_fd_set);
|
||||||
*max_fd = conn->sockfd;
|
*max_fd = conn->sockfd;
|
||||||
conn->keep.readfdp = read_fd_set; /* store the address of the set */
|
|
||||||
}
|
}
|
||||||
if(conn->keep.keepon & KEEP_WRITE) {
|
if(conn->keep.keepon & KEEP_WRITE) {
|
||||||
FD_SET(conn->writesockfd, write_fd_set);
|
FD_SET(conn->writesockfd, write_fd_set);
|
||||||
@ -1500,7 +1490,6 @@ void Curl_single_fdset(struct connectdata *conn,
|
|||||||
to compare it nicely */
|
to compare it nicely */
|
||||||
if((int)conn->writesockfd > *max_fd)
|
if((int)conn->writesockfd > *max_fd)
|
||||||
*max_fd = conn->writesockfd;
|
*max_fd = conn->writesockfd;
|
||||||
conn->keep.writefdp = write_fd_set; /* store the address of the set */
|
|
||||||
}
|
}
|
||||||
/* we don't use exceptions, only touch that one to prevent compiler
|
/* we don't use exceptions, only touch that one to prevent compiler
|
||||||
warnings! */
|
warnings! */
|
||||||
@ -1543,9 +1532,6 @@ Transfer(struct connectdata *conn)
|
|||||||
if(!conn->bits.getheader && conn->bits.no_body)
|
if(!conn->bits.getheader && conn->bits.no_body)
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|
||||||
k->writefdp = &k->writefd; /* store the address of the set */
|
|
||||||
k->readfdp = &k->readfd; /* store the address of the set */
|
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
int fd_read;
|
int fd_read;
|
||||||
int fd_write;
|
int fd_write;
|
||||||
|
@ -410,15 +410,6 @@ struct Curl_transfer_keeper {
|
|||||||
char *uploadbuf;
|
char *uploadbuf;
|
||||||
curl_socket_t maxfd;
|
curl_socket_t maxfd;
|
||||||
|
|
||||||
/* pointers to the actual descriptors we check */
|
|
||||||
fd_set *readfdp;
|
|
||||||
fd_set *writefdp;
|
|
||||||
|
|
||||||
/* the file descriptors to play with */
|
|
||||||
fd_set readfd;
|
|
||||||
fd_set writefd;
|
|
||||||
fd_set rkeepfd;
|
|
||||||
fd_set wkeepfd;
|
|
||||||
int keepon;
|
int keepon;
|
||||||
|
|
||||||
bool upload_done; /* set to TRUE when doing chunked transfer-encoding upload
|
bool upload_done; /* set to TRUE when doing chunked transfer-encoding upload
|
||||||
|
Loading…
Reference in New Issue
Block a user