增加HTTP-Kill/TCP-Kill功能
This commit is contained in:
@@ -1183,3 +1183,27 @@ void tfe_stream_write_access_log(const struct tfe_stream * stream, int level, co
|
||||
MESA_handle_runtime_log(_stream->stream_logger, level, "access", "%s %s", _stream->str_stream_addr, __tmp_buffer);
|
||||
free(__tmp_buffer);
|
||||
}
|
||||
|
||||
|
||||
int tfe_stream_shutdown(const struct tfe_stream * stream)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tfe_stream_shutdown_dir(const struct tfe_stream * stream, enum tfe_conn_dir dir)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tfe_stream_kill(const struct tfe_stream * stream)
|
||||
{
|
||||
struct tfe_stream_private * _stream = to_stream_private(stream);
|
||||
const static struct linger sl {.l_onoff = 1, .l_linger = 0};
|
||||
|
||||
/* Set SO_LINGER, the fd will be closed by RST */
|
||||
setsockopt(_stream->conn_upstream->fd, SOL_SOCKET, SO_LINGER, &sl, sizeof(sl));
|
||||
setsockopt(_stream->conn_downstream->fd, SOL_SOCKET, SO_LINGER, &sl, sizeof(sl));
|
||||
|
||||
/* Destroy STREAM */
|
||||
return tfe_stream_destory(_stream);
|
||||
}
|
||||
Reference in New Issue
Block a user