| 296 |
{ |
{ |
| 297 |
if (events[i].data.fd == socket_server[0] || events[i].data.fd == socket_server[1]) |
if (events[i].data.fd == socket_server[0] || events[i].data.fd == socket_server[1]) |
| 298 |
{ |
{ |
| 299 |
SSH_v2 = (events[i].data.fd == socket_server[1]); |
SSH_v2 = (events[i].data.fd == socket_server[1] ? 1 : 0); |
| 300 |
|
|
| 301 |
while (!SYS_server_exit) // Accept all incoming connections until error |
while (!SYS_server_exit) // Accept all incoming connections until error |
| 302 |
{ |
{ |
| 303 |
addrlen = sizeof(sin); |
addrlen = sizeof(sin); |
| 304 |
socket_client = accept(events[i].data.fd, (struct sockaddr *)&sin, &addrlen); |
socket_client = accept(socket_server[SSH_v2], (struct sockaddr *)&sin, &addrlen); |
| 305 |
if (socket_client < 0) |
if (socket_client < 0) |
| 306 |
{ |
{ |
| 307 |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
| 324 |
|
|
| 325 |
port_client = ntohs(sin.sin_port); |
port_client = ntohs(sin.sin_port); |
| 326 |
|
|
| 327 |
log_common("Accept connection from %s:%d\n", hostaddr_client, port_client); |
log_common("Accept %sconnection from %s:%d\n", (SSH_v2 ? "" : "SSH2 "), hostaddr_client, port_client); |
| 328 |
|
|
| 329 |
if (SYS_child_process_count - 1 < BBS_max_client) |
if (SYS_child_process_count - 1 < BBS_max_client) |
| 330 |
{ |
{ |