mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 08:48:21 +01:00
add ssl debug info
This commit is contained in:
parent
3f2af063aa
commit
079f96de66
BIN
dist/antd-1.0.4b.tar.gz
vendored
BIN
dist/antd-1.0.4b.tar.gz
vendored
Binary file not shown.
@ -88,6 +88,8 @@ int antd_send(void *src, const void* data, int len)
|
|||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
while (writelen > 0) //source->attempt < MAX_ATTEMPT
|
while (writelen > 0) //source->attempt < MAX_ATTEMPT
|
||||||
{
|
{
|
||||||
|
// clear the error queue
|
||||||
|
ERR_clear_error();
|
||||||
count = SSL_write (source->ssl, ptr+written, writelen);
|
count = SSL_write (source->ssl, ptr+written, writelen);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
@ -160,7 +162,7 @@ int antd_send(void *src, const void* data, int len)
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
// other error
|
// other error
|
||||||
ERROR("SSL WRITE: Unknown error on %d: %d", source->sock, err);
|
ERROR("SSL WRITE: Unknown error on %d: %s", source->sock, ERR_error_string(ERR_get_error(), NULL) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,6 +220,7 @@ int antd_recv(void *src, void* data, int len)
|
|||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
while (readlen > 0 )//&& source->attempt < MAX_ATTEMPT
|
while (readlen > 0 )//&& source->attempt < MAX_ATTEMPT
|
||||||
{
|
{
|
||||||
|
ERR_clear_error();
|
||||||
received = SSL_read (source->ssl, ptr+read, readlen);
|
received = SSL_read (source->ssl, ptr+read, readlen);
|
||||||
if (received > 0)
|
if (received > 0)
|
||||||
{
|
{
|
||||||
@ -290,7 +293,7 @@ int antd_recv(void *src, void* data, int len)
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
// other error
|
// other error
|
||||||
ERROR("SSL READ: unkown error on %d: %d", source->sock, err);
|
ERROR("SSL READ: unkown error on %d: %s", source->sock, ERR_error_string(ERR_get_error(), NULL));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user