400 /* create Connection object */ |
400 /* create Connection object */ |
401 Connection *conn = malloc(sizeof(Connection)); |
401 Connection *conn = malloc(sizeof(Connection)); |
402 conn->address = ca; |
402 conn->address = ca; |
403 conn->fd = clientfd; |
403 conn->fd = clientfd; |
404 conn->listener = ls; |
404 conn->listener = ls; |
|
405 conn->ssl_accepted = 0; |
405 if(ls->ssl) { |
406 if(ls->ssl) { |
406 // SSL connections are always non-blocking |
407 // SSL connections are always non-blocking |
407 // set socket non blocking |
408 // set socket non blocking |
408 int flags; |
409 int flags; |
409 if((flags = fcntl(conn->fd, F_GETFL, 0)) == -1) { |
410 if((flags = fcntl(conn->fd, F_GETFL, 0)) == -1) { |