mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:32:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			953 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			953 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 | |
| From: Ali Mohammad Pur <ali.mpfard@gmail.com>
 | |
| Date: Fri, 9 Jul 2021 04:59:05 +0430
 | |
| Subject: [PATCH] tcp: Don't use SO_LINGER
 | |
| 
 | |
| ---
 | |
|  src/unix/tcp.c | 4 ++++
 | |
|  1 file changed, 4 insertions(+)
 | |
| 
 | |
| diff --git a/src/unix/tcp.c b/src/unix/tcp.c
 | |
| index 789807f..f92af6b 100644
 | |
| --- a/src/unix/tcp.c
 | |
| +++ b/src/unix/tcp.c
 | |
| @@ -313,15 +313,19 @@ int uv_tcp_getpeername(const uv_tcp_t* handle,
 | |
|  
 | |
|  int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) {
 | |
|    int fd;
 | |
| +#ifndef __serenity__
 | |
|    struct linger l = { 1, 0 };
 | |
| +#endif
 | |
|  
 | |
|    /* Disallow setting SO_LINGER to zero due to some platform inconsistencies */
 | |
|    if (handle->flags & UV_HANDLE_SHUTTING)
 | |
|      return UV_EINVAL;
 | |
|  
 | |
|    fd = uv__stream_fd(handle);
 | |
| +#ifndef __serenity__
 | |
|    if (0 != setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)))
 | |
|      return UV__ERR(errno);
 | |
| +#endif
 | |
|  
 | |
|    uv_close((uv_handle_t*) handle, close_cb);
 | |
|    return 0;
 | 
