CRAS: cras_rclient: Add cras_rclient_create
Add cras_rclient_create back with an extra argument related to client
connection type. The function will choose the right create function for
users by the given connection type.
Simplify handle_new_connection by adding connection type attribute to
server_socket.
Let fuzzer use cras_rclient_create.
BUG=chromium:937765
TEST=Build and run
$ cras_test_client --connection_type 1 -P /dev/urandom
$ cras_test_client --connection_type 1 -C /dev/urandom (This should
fail.)
Change-Id: I64d07bd87d01e34c95549c84acad11ad5cca0fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/1836843
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
4 files changed