| 175 | } |
| 176 | |
| 177 | static evutil_socket_t bind_socket(const char* address, ev_uint16_t port, int reuse) { |
| 178 | evutil_socket_t fd; |
| 179 | struct evutil_addrinfo* aitop = NULL; |
| 180 | |
| 181 | /* just create an unbound socket */ |
| 182 | if (address == NULL && port == 0) return bind_socket_ai(NULL, 0); |
| 183 | |
| 184 | aitop = make_addrinfo(address, port); |
| 185 | |
| 186 | if (aitop == NULL) return (-1); |
| 187 | |
| 188 | fd = bind_socket_ai(aitop, reuse); |
| 189 | |
| 190 | evutil_freeaddrinfo(aitop); |
| 191 | |
| 192 | return (fd); |
| 193 | } |
| 194 | |
| 195 | struct evhttp_bound_socket* evhttp_bind_accept_socket(struct evhttp* http, const char* address, |
| 196 | ev_uint16_t port) { |
no test coverage detected