File: 002-socket_t.patch

package info (click to toggle)
proxy-suite 1.9.2.4-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,068 kB
  • sloc: ansic: 6,533; sh: 2,968; makefile: 284
file content (36 lines) | stat: -rw-r--r-- 914 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: use socklen_t instead of int in socket functions
 Use socklen_t instead of int as addrlen type in socket functions.
Author: Roberto Lumbreras <rover@debian.org>

--- proxy-suite-1.9.2.4.orig/common/com-socket.c
+++ proxy-suite-1.9.2.4/common/com-socket.c
@@ -311,7 +311,8 @@ static void socket_accept(void)
 	char peer[PEER_LEN] = {0};
 	char dest[PEER_LEN] = {0};
 	struct sockaddr_in saddr;
-	int nsock, len;
+	int nsock;
+	socklen_t len;
 
 	/*
 	** Let the show begin ...
@@ -1001,7 +1002,8 @@ int socket_exec(int timeout, int *close_
 
 static void socket_ll_read(HLS *hls)
 {
-	int len, cnt, nsock;
+	int cnt, nsock;
+	socklen_t len;
 	BUF *buf, *tmp;
 	struct sockaddr_in saddr;
 
@@ -1836,7 +1838,8 @@ char *socket_addr2str(u_int32_t addr)
 u_int32_t socket_sck2addr(int sock, int peer, u_int16_t *port)
 {
 	struct sockaddr_in saddr;
-	int len, r;
+	int r;
+	socklen_t len;
 	char *s;
 
 	/*