mirror of
https://github.com/brunoos/luasec.git
synced 2024-11-07 22:18:27 +01:00
LuaSec 0.3.3
This commit is contained in:
parent
d28c5e4f9e
commit
29c6bd65d2
@ -1,3 +1,10 @@
|
||||
--------------------------------------------------------------------------------
|
||||
LuaSec 0.3.3
|
||||
------------
|
||||
- BUG: Clear the error queue before call I/O functions (see SSL_get_error
|
||||
manual).
|
||||
(thanks Matthew Wild)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
LuaSec 0.3.2
|
||||
------------
|
||||
|
2
INSTALL
2
INSTALL
@ -1,4 +1,4 @@
|
||||
LuaSec 0.3.2
|
||||
LuaSec 0.3.3
|
||||
------------
|
||||
|
||||
* On Linux, BSD, and Mac OS X:
|
||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
LuaSec 0.3.2 license
|
||||
LuaSec 0.3.3 license
|
||||
Copyright (C) 2006-2009 Bruno Silvestre
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*--------------------------------------------------------------------------
|
||||
* LuaSec 0.3.2
|
||||
* LuaSec 0.3.3
|
||||
* Copyright (C) 2006-2009 Bruno Silvestre
|
||||
*
|
||||
*--------------------------------------------------------------------------*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __CONTEXT_H__
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
* LuaSec 0.3.2
|
||||
* LuaSec 0.3.3
|
||||
* Copyright (C) 2006-2009 Bruno Silvestre
|
||||
*
|
||||
*--------------------------------------------------------------------------*/
|
||||
|
14
src/ssl.c
14
src/ssl.c
@ -1,5 +1,5 @@
|
||||
/*--------------------------------------------------------------------------
|
||||
* LuaSec 0.3.2
|
||||
* LuaSec 0.3.3
|
||||
* Copyright (C) 2006-2009 Bruno Silvestre
|
||||
*
|
||||
*--------------------------------------------------------------------------*/
|
||||
@ -63,11 +63,13 @@ static int meth_destroy(lua_State *L)
|
||||
*/
|
||||
static int handshake(p_ssl ssl)
|
||||
{
|
||||
int err;
|
||||
p_timeout tm = timeout_markstart(&ssl->tm);
|
||||
if (ssl->state == ST_SSL_CLOSED)
|
||||
return IO_CLOSED;
|
||||
for ( ; ; ) {
|
||||
int err = SSL_do_handshake(ssl->ssl);
|
||||
ERR_clear_error();
|
||||
err = SSL_do_handshake(ssl->ssl);
|
||||
ssl->error = SSL_get_error(ssl->ssl, err);
|
||||
switch(ssl->error) {
|
||||
case SSL_ERROR_NONE:
|
||||
@ -104,12 +106,14 @@ static int handshake(p_ssl ssl)
|
||||
static int ssl_send(void *ctx, const char *data, size_t count, size_t *sent,
|
||||
p_timeout tm)
|
||||
{
|
||||
int err;
|
||||
p_ssl ssl = (p_ssl) ctx;
|
||||
if (ssl->state == ST_SSL_CLOSED)
|
||||
return IO_CLOSED;
|
||||
*sent = 0;
|
||||
for ( ; ; ) {
|
||||
int err = SSL_write(ssl->ssl, data, (int) count);
|
||||
ERR_clear_error();
|
||||
err = SSL_write(ssl->ssl, data, (int) count);
|
||||
ssl->error = SSL_get_error(ssl->ssl, err);
|
||||
switch(ssl->error) {
|
||||
case SSL_ERROR_NONE:
|
||||
@ -146,12 +150,14 @@ static int ssl_send(void *ctx, const char *data, size_t count, size_t *sent,
|
||||
static int ssl_recv(void *ctx, char *data, size_t count, size_t *got,
|
||||
p_timeout tm)
|
||||
{
|
||||
int err;
|
||||
p_ssl ssl = (p_ssl) ctx;
|
||||
if (ssl->state == ST_SSL_CLOSED)
|
||||
return IO_CLOSED;
|
||||
*got = 0;
|
||||
for ( ; ; ) {
|
||||
int err = SSL_read(ssl->ssl, data, (int) count);
|
||||
ERR_clear_error();
|
||||
err = SSL_read(ssl->ssl, data, (int) count);
|
||||
ssl->error = SSL_get_error(ssl->ssl, err);
|
||||
switch(ssl->error) {
|
||||
case SSL_ERROR_NONE:
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __SSL_H__
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
* LuaSec 0.3.2
|
||||
* LuaSec 0.3.3
|
||||
* Copyright (C) 2006-2009 Bruno Silvestre
|
||||
*
|
||||
*--------------------------------------------------------------------------*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
------------------------------------------------------------------------------
|
||||
-- LuaSec 0.3.2
|
||||
-- Copyright (C) 2006-2008 Bruno Silvestre
|
||||
-- LuaSec 0.3.3
|
||||
-- Copyright (C) 2006-2009 Bruno Silvestre
|
||||
--
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -10,8 +10,8 @@ require("ssl.core")
|
||||
require("ssl.context")
|
||||
|
||||
|
||||
_VERSION = "0.3.2"
|
||||
_COPYRIGHT = "LuaSec 0.3.2 - Copyright (C) 2006-2009 Bruno Silvestre\n" ..
|
||||
_VERSION = "0.3.3"
|
||||
_COPYRIGHT = "LuaSec 0.3.3 - Copyright (C) 2006-2009 Bruno Silvestre\n" ..
|
||||
"LuaSocket 2.0.2 - Copyright (C) 2004-2007 Diego Nehab"
|
||||
|
||||
-- Export functions
|
||||
|
Loading…
Reference in New Issue
Block a user