修复ssl_stream_new中不必要的getpeername以及由此造成的写越界。
This commit is contained in:
@@ -156,7 +156,7 @@ void future_destroy(struct future * f)
|
|||||||
struct promise * p = future_to_promise(f);
|
struct promise * p = future_to_promise(f);
|
||||||
if (p->cb_ctx_destroy != NULL)
|
if (p->cb_ctx_destroy != NULL)
|
||||||
{
|
{
|
||||||
p->cb_ctx_destroy(p);
|
p->cb_ctx_destroy(p->ctx);
|
||||||
}
|
}
|
||||||
FS_operate(g_FP_instance.fs_handle,g_FP_instance.fsid_f_num, 0, FS_OP_SUB, 1);
|
FS_operate(g_FP_instance.fs_handle,g_FP_instance.fsid_f_num, 0, FS_OP_SUB, 1);
|
||||||
memset(p, 0, sizeof(struct promise));
|
memset(p, 0, sizeof(struct promise));
|
||||||
|
|||||||
@@ -234,14 +234,12 @@ void ssl_free_chello(struct ssl_chello * p)
|
|||||||
struct ssl_stream * ssl_stream_new(struct ssl_mgr * mgr, evutil_socket_t fd, enum tfe_conn_dir dir,
|
struct ssl_stream * ssl_stream_new(struct ssl_mgr * mgr, evutil_socket_t fd, enum tfe_conn_dir dir,
|
||||||
struct ssl_chello * client_hello, struct keyring * kyr)
|
struct ssl_chello * client_hello, struct keyring * kyr)
|
||||||
{
|
{
|
||||||
struct sockaddr addr;
|
|
||||||
socklen_t addrlen;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct ssl_stream * s_stream = ALLOC(struct ssl_stream, 1);
|
struct ssl_stream * s_stream = ALLOC(struct ssl_stream, 1);
|
||||||
s_stream->dir = dir;
|
s_stream->dir = dir;
|
||||||
s_stream->mgr = mgr;
|
s_stream->mgr = mgr;
|
||||||
s_stream->_do_not_use.fd = fd;
|
s_stream->_do_not_use.fd = fd;
|
||||||
ret = getpeername(fd, &addr, &addrlen);
|
|
||||||
assert(ret == 0);
|
assert(ret == 0);
|
||||||
switch (dir)
|
switch (dir)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user