sendrecv: split the I/O handling into private handler
Howard Chu brought the bulk work of this patch that properly moves out the sending and recving of data to the parts of the code that are properly responsible for the various ways of doing so. Daniel Stenberg assisted with polishing a few bits and fixed some minor flaws in the original patch. Another upside of this patch is that we now abuse CURLcodes less with the "magic" -1 return codes and instead use CURLE_AGAIN more consistently.
This commit is contained in:
committed by
Daniel Stenberg
parent
cb6647ce1c
commit
d64bd82bdc
19
lib/sendf.h
19
lib/sendf.h
@@ -55,15 +55,20 @@ CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr,
|
||||
size_t len);
|
||||
|
||||
/* internal read-function, does plain socket only */
|
||||
int Curl_read_plain(curl_socket_t sockfd,
|
||||
char *buf,
|
||||
size_t bytesfromsocket,
|
||||
ssize_t *n);
|
||||
CURLcode Curl_read_plain(curl_socket_t sockfd,
|
||||
char *buf,
|
||||
size_t bytesfromsocket,
|
||||
ssize_t *n);
|
||||
|
||||
ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf,
|
||||
size_t len, CURLcode *code);
|
||||
ssize_t Curl_send_plain(struct connectdata *conn, int num,
|
||||
const void *mem, size_t len, CURLcode *code);
|
||||
|
||||
/* internal read-function, does plain socket, SSL and krb4 */
|
||||
int Curl_read(struct connectdata *conn, curl_socket_t sockfd,
|
||||
char *buf, size_t buffersize,
|
||||
ssize_t *n);
|
||||
CURLcode Curl_read(struct connectdata *conn, curl_socket_t sockfd,
|
||||
char *buf, size_t buffersize,
|
||||
ssize_t *n);
|
||||
/* internal write-function, does plain socket, SSL, SCP, SFTP and krb4 */
|
||||
CURLcode Curl_write(struct connectdata *conn,
|
||||
curl_socket_t sockfd,
|
||||
|
||||
Reference in New Issue
Block a user