mirror of https://github.com/F-Stack/f-stack.git
Nginx: hijack `shutdown`.
In some cases, nginx will call `ngx_shutdown_socket`, so we need to hijack `shutdown`.
This commit is contained in:
parent
0ed3d39215
commit
e036d21d68
|
@ -117,6 +117,8 @@ static ssize_t (*real_readv)(int, const struct iovec *, int);
|
||||||
static ssize_t (*real_read)(int, void *, size_t);
|
static ssize_t (*real_read)(int, void *, size_t);
|
||||||
static ssize_t (*real_write)(int, const void *, size_t);
|
static ssize_t (*real_write)(int, const void *, size_t);
|
||||||
|
|
||||||
|
static int (*real_shutdown)(int, int);
|
||||||
|
|
||||||
static int (*real_ioctl)(int, int, void *);
|
static int (*real_ioctl)(int, int, void *);
|
||||||
|
|
||||||
static int (*real_gettimeofday)(struct timeval *tv, struct timezone *tz);
|
static int (*real_gettimeofday)(struct timeval *tv, struct timezone *tz);
|
||||||
|
@ -444,6 +446,17 @@ close(int sockfd)
|
||||||
return SYSCALL(close)(sockfd);
|
return SYSCALL(close)(sockfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
shutdown(int sockfd, int how)
|
||||||
|
{
|
||||||
|
if(is_fstack_fd(sockfd)){
|
||||||
|
sockfd = restore_fstack_fd(sockfd);
|
||||||
|
return ff_close(sockfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SYSCALL(shutdown)(sockfd, how);
|
||||||
|
}
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
writev(int sockfd, const struct iovec *iov, int iovcnt)
|
writev(int sockfd, const struct iovec *iov, int iovcnt)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue