Mercurial > dropbear
comparison listener.c @ 1478:3a933956437e coverity
update coverity
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 09 Feb 2018 23:49:22 +0800 |
parents | 58a74cb829b8 |
children | ce3ce75a6e04 |
comparison
equal
deleted
inserted
replaced
1439:8d24733026c5 | 1478:3a933956437e |
---|---|
51 } | 51 } |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 void handle_listeners(fd_set * readfds) { | 56 void handle_listeners(const fd_set * readfds) { |
57 | 57 |
58 unsigned int i, j; | 58 unsigned int i, j; |
59 struct Listener *listener; | 59 struct Listener *listener; |
60 int sock; | 60 int sock; |
61 | 61 |
74 } /* Woo brace matching */ | 74 } /* Woo brace matching */ |
75 | 75 |
76 | 76 |
77 /* acceptor(int fd, void* typedata) is a function to accept connections, | 77 /* acceptor(int fd, void* typedata) is a function to accept connections, |
78 * cleanup(void* typedata) happens when cleaning up */ | 78 * cleanup(void* typedata) happens when cleaning up */ |
79 struct Listener* new_listener(int socks[], unsigned int nsocks, | 79 struct Listener* new_listener(const int socks[], unsigned int nsocks, |
80 int type, void* typedata, | 80 int type, void* typedata, |
81 void (*acceptor)(struct Listener* listener, int sock), | 81 void (*acceptor)(const struct Listener* listener, int sock), |
82 void (*cleanup)(struct Listener*)) { | 82 void (*cleanup)(const struct Listener*)) { |
83 | 83 |
84 unsigned int i, j; | 84 unsigned int i, j; |
85 struct Listener *newlisten = NULL; | 85 struct Listener *newlisten = NULL; |
86 /* try get a new structure to hold it */ | 86 /* try get a new structure to hold it */ |
87 for (i = 0; i < ses.listensize; i++) { | 87 for (i = 0; i < ses.listensize; i++) { |
130 return newlisten; | 130 return newlisten; |
131 } | 131 } |
132 | 132 |
133 /* Return the first listener which matches the type-specific comparison | 133 /* Return the first listener which matches the type-specific comparison |
134 * function. Particularly needed for global requests, like tcp */ | 134 * function. Particularly needed for global requests, like tcp */ |
135 struct Listener * get_listener(int type, void* typedata, | 135 struct Listener * get_listener(int type, const void* typedata, |
136 int (*match)(void*, void*)) { | 136 int (*match)(const void*, const void*)) { |
137 | 137 |
138 unsigned int i; | 138 unsigned int i; |
139 struct Listener* listener; | 139 struct Listener* listener; |
140 | 140 |
141 for (i = 0, listener = ses.listeners[i]; i < ses.listensize; i++) { | 141 for (i = 0, listener = ses.listeners[i]; i < ses.listensize; i++) { |