* \param buf chars to send to the client
* \param nbytes how many chars
*/
-void client_write_ssl(const char *buf, int nbytes)
+void client_write_ssl(const StrBuf *Buf)
{
+ const char *buf;
int retval;
int nremain;
+ long nbytes;
char junk[1];
if (THREADSSL == NULL) return;
- nremain = nbytes;
+ nbytes = nremain = StrLength(Buf);
+ buf = ChrPtr(Buf);
while (nremain > 0) {
if (SSL_want_write(THREADSSL)) {
int starttls(int sock);
extern SSL_CTX *ssl_ctx;
int client_read_ssl(char *buf, int bytes, int timeout);
-void client_write_ssl(const char *buf, int nbytes);
+void client_write_ssl(const StrBuf *Buf);
#endif
#ifdef HAVE_ZLIB
#ifdef HAVE_OPENSSL
if (is_https) {
- client_write_ssl(ptr, StrLength(WCC->HBuf));
+ client_write_ssl(WCC->HBuf);
+ client_write_ssl(WCC->WBuf);
return (count);
}
#endif
#endif
fdflags = fcntl(WC->http_sock, F_GETFL);
- while (ptr < eptr) {
+ while (ptr < eptr) {
if ((fdflags & O_NONBLOCK) == O_NONBLOCK) {
FD_ZERO(&wset);
FD_SET(WCC->http_sock, &wset);
count = StrLength(WCC->WBuf);
eptr = ptr + count;
-#ifdef HAVE_OPENSSL
- if (is_https) {
- client_write_ssl(ptr, StrLength(WCC->HBuf));
- return (count);
- }
-#endif
-
#ifdef HTTP_TRACING
write(2, "\033[34m", 5);