mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 14:33:55 +00:00
fix a timeout issue
This commit is contained in:
+3
-3
@@ -519,13 +519,13 @@ void cipher_context_release(cipher_ctx_t *evp) {
|
||||
#endif
|
||||
}
|
||||
|
||||
int cipher_context_update(cipher_ctx_t *evp, uint8_t *output, int *olen, \
|
||||
int cipher_context_update(cipher_ctx_t *evp, uint8_t *output, int *olen,
|
||||
const uint8_t *input, int ilen) {
|
||||
#if defined(USE_CRYPTO_OPENSSL)
|
||||
return EVP_CipherUpdate(evp, (uint8_t *) output, (size_t *) olen, \
|
||||
return EVP_CipherUpdate(evp, (uint8_t *) output, olen,
|
||||
(const uint8_t *) input, (size_t) ilen);
|
||||
#elif defined(USE_CRYPTO_POLARSSL)
|
||||
return !cipher_update(evp, (const uint8_t *) input, (size_t) ilen, \
|
||||
return !cipher_update(evp, (const uint8_t *) input, (size_t) ilen,
|
||||
(uint8_t *) output, (size_t *) olen);
|
||||
#endif
|
||||
}
|
||||
|
||||
-17
@@ -35,23 +35,6 @@ static char *to_string(const json_value *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int to_int(const json_value *value)
|
||||
{
|
||||
if (value->type == json_string)
|
||||
{
|
||||
return atoi(value->u.string.ptr);
|
||||
}
|
||||
else if (value->type == json_integer)
|
||||
{
|
||||
return value->u.integer;
|
||||
}
|
||||
else
|
||||
{
|
||||
FATAL("Invalid config format.");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void parse_addr(const char *str, remote_addr_t *addr) {
|
||||
int ret = -1;
|
||||
char *pch;
|
||||
|
||||
+2
-5
@@ -302,12 +302,9 @@ void close_and_free_remote(EV_P_ struct remote_ctx *ctx)
|
||||
{
|
||||
if (ctx != NULL)
|
||||
{
|
||||
close(ctx->fd);
|
||||
ev_timer_stop(EV_A_ &ctx->watcher);
|
||||
if (ctx->addr_header != NULL)
|
||||
{
|
||||
free(ctx->addr_header);
|
||||
}
|
||||
ev_io_stop(EV_A_ &ctx->io);
|
||||
close(ctx->fd);
|
||||
free(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user