31 #ifdef HAVE_SYS_TYPES_H
32 #include <sys/types.h>
35 #ifdef HAVE_SYS_SOCKET_H
36 #include <sys/socket.h>
48 #define _MPRINTF_REPLACE
98 last = slist_get_last(list);
99 last->
next = new_item;
134 char print_buffer[1024 + 1];
173 const char *fmt, ...)
183 s = vaprintf(fmt, ap);
189 write_len = strlen(s);
194 res =
Curl_write(conn, sockfd, sptr, write_len, &bytes_written);
202 if((
size_t)bytes_written != write_len) {
205 write_len -= bytes_written;
206 sptr += bytes_written;
239 char error_buffer[120];
242 int rc = SSL_write(conn->
ssl[num].handle, mem, len);
245 err = SSL_get_error(conn->
ssl[num].handle, rc);
248 case SSL_ERROR_WANT_READ:
249 case SSL_ERROR_WANT_WRITE:
255 case SSL_ERROR_SYSCALL:
256 failf(conn->
data,
"SSL_write() returned SYSCALL, errno = %d\n",
262 sslerror = ERR_get_error();
263 failf(conn->
data,
"SSL_write() error: %s\n",
264 ERR_error_string(sslerror, error_buffer));
268 failf(conn->
data,
"SSL_write() return error %d\n", err);
278 if(conn->sec_complete) {
286 if(-1 == bytes_written) {
290 #ifdef WSAEWOULDBLOCK
292 (WSAEWOULDBLOCK == err)
298 (EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err)
308 *written = bytes_written;
332 failf (data,
"Failed writing body");
347 failf (data,
"Failed writing header");
378 nread = SSL_read(conn->
ssl[num].handle, buf, buffersize);
382 int err = SSL_get_error(conn->
ssl[num].handle, nread);
386 case SSL_ERROR_ZERO_RETURN:
388 case SSL_ERROR_WANT_READ:
389 case SSL_ERROR_WANT_WRITE:
395 char error_buffer[120];
397 int sslerror = ERR_get_error();
398 failf(conn->
data,
"SSL read: %s, errno %d",
399 ERR_error_string(sslerror, error_buffer),
412 if(conn->sec_complete)
416 nread =
sread(sockfd, buf, buffersize);
422 if(WSAEWOULDBLOCK == err)
424 if((EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err))
440 char *ptr,
size_t size)
443 "* ",
"< ",
"> ",
"{ ",
"} " };
struct ssl_connect_data ssl[2]
void Curl_failf(struct SessionHandle *data, const char *fmt,...)
void curl_slist_free_all(struct curl_slist *list)
curl_write_callback fwrite_header
CURLcode Curl_client_write(struct SessionHandle *data, int type, char *ptr, size_t len)
int Curl_sec_write(struct connectdata *conn, int, char *, int)
GLuint GLuint GLsizei GLenum type
size_t(* curl_write_callback)(char *buffer, size_t size, size_t nitems, void *outstream)
int Curl_sec_read(struct connectdata *conn, int, void *, int)
int Curl_read(struct connectdata *conn, curl_socket_t sockfd, char *buf, size_t buffersize, ssize_t *n)
CURLcode Curl_write(struct connectdata *conn, curl_socket_t sockfd, void *mem, size_t len, ssize_t *written)
struct curl_slist * curl_slist_append(struct curl_slist *list, const char *data)
GLsizei GLsizei GLenum GLenum const GLvoid * data
#define CLIENTWRITE_HEADER
curl_debug_callback fdebug
struct SessionHandle * data
int Curl_debug(struct SessionHandle *data, curl_infotype type, char *ptr, size_t size)
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void Curl_infof(struct SessionHandle *data, const char *fmt,...)
curl_write_callback fwrite
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn, const char *fmt,...)