aboutsummaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 87416775c..e048637be 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -84,7 +84,6 @@ void failf(struct UrlData *data, char *fmt, ...)
}
/* sendf() sends the formated data to the server */
-
int sendf(int fd, struct UrlData *data, char *fmt, ...)
{
size_t bytes_written;
@@ -110,6 +109,25 @@ int sendf(int fd, struct UrlData *data, char *fmt, ...)
return(bytes_written);
}
+/* ssend() sends plain (binary) data to the server */
+size_t ssend(int fd, struct UrlData *data, void *mem, size_t len)
+{
+ size_t bytes_written;
+
+ if(data->bits.verbose)
+ fprintf(data->err, "> [binary output]\n");
+#ifndef USE_SSLEAY
+ bytes_written = swrite(fd, mem, len);
+#else
+ if (data->use_ssl) {
+ bytes_written = SSL_write(data->ssl, mem, len);
+ } else {
+ bytes_written = swrite(fd, mem, len);
+ }
+#endif /* USE_SSLEAY */
+ return bytes_written;
+}
+