summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'nanohttp/nanohttp-ssl.c')
-rw-r--r--nanohttp/nanohttp-ssl.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/nanohttp/nanohttp-ssl.c b/nanohttp/nanohttp-ssl.c
index 1a98ed5..8b8fb5d 100644
--- a/nanohttp/nanohttp-ssl.c
+++ b/nanohttp/nanohttp-ssl.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-ssl.c,v 1.32 2006/11/26 20:13:06 m0gg Exp $
+* $Id: nanohttp-ssl.c,v 1.33 2006/11/27 12:47:27 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2001-2005 Rochester Institute of Technology
@@ -65,7 +65,10 @@
#include <io.h>
#endif
-#ifdef HAVE_SSL
+#ifdef HAVE_OPENSSL_SSL_H
+#include <openssl/ssl.h>
+#endif
+
#ifdef HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
#endif
@@ -73,7 +76,6 @@
#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
#endif
-#endif
#include "nanohttp-error.h"
#include "nanohttp-common.h"
@@ -82,8 +84,6 @@
#include "nanohttp-ssl.h"
-#ifdef HAVE_SSL
-
static char *certificate = NULL;
static char *certpass = "";
static char *ca_list = NULL;
@@ -540,7 +540,6 @@ hssl_read(struct hsocket_t * sock, char *buf, size_t len, size_t * received)
return herror_new("hssl_read", HSOCKET_ERROR_RECEIVE,
"recv failed (%s)", strerror(errno));
}
- sock->bytes_received += count;
*received = count;
return H_OK;
@@ -567,41 +566,7 @@ hssl_write(struct hsocket_t * sock, const char *buf, size_t len, size_t * sent)
return herror_new("hssl_write", HSOCKET_ERROR_SEND, "send failed (%s)",
strerror(errno));
}
- sock->bytes_transmitted += count;
- *sent = count;
-
- return H_OK;
-}
-
-#else
-
-herror_t
-hssl_read(struct hsocket_t * sock, char *buf, size_t len, size_t * received)
-{
- int count;
-
- if ((count = hsocket_select_recv(sock->sock, buf, len)) == -1)
- return herror_new("hssl_read", HSOCKET_ERROR_RECEIVE, "recv failed (%s)",
- strerror(errno));
- sock->bytes_received += count;
- *received = count;
-
- return H_OK;
-}
-
-
-herror_t
-hssl_write(struct hsocket_t * sock, const char *buf, size_t len, size_t * sent)
-{
- int count;
-
- if ((count = send(sock->sock, buf, len, 0)) == -1)
- return herror_new("hssl_write", HSOCKET_ERROR_SEND, "send failed (%s)",
- strerror(errno));
- sock->bytes_received += count;
*sent = count;
return H_OK;
}
-
-#endif