]> Kevux Git Server - fll/commit
Bugfix: The socket id is not the same descriptor for reading.
authorKevin Day <kevin@kevux.org>
Sat, 5 Aug 2023 15:40:14 +0000 (10:40 -0500)
committerKevin Day <kevin@kevux.org>
Sat, 5 Aug 2023 15:45:58 +0000 (10:45 -0500)
commit65def22186998f9a25c24ccb7e8fd5bb6ea139cf
tree97435bafa07dbd685acd7561fafbfe00c52e9ba4
parent9b7017867a16e46ed4ffcecacd60e78cdb0805c6
Bugfix: The socket id is not the same descriptor for reading.

When binding and listening on some socket id, the accept call on that socket creates a new descriptor.
That descriptor is not the same as the original socket id.

Add a new id_data to the socket structure to represent the data transfer file descriptor that is created via the accept() call.
Add a new f_file_close_id() to close the file by the id in case the f_file_t is not available or in use.
13 files changed:
level_0/f_file/c/file.c
level_0/f_file/c/file.h
level_0/f_file/c/private-file.c
level_0/f_file/c/private-file.h
level_0/f_file/data/build/settings-tests
level_0/f_file/tests/unit/c/test-file-close_id.c [new file with mode: 0644]
level_0/f_file/tests/unit/c/test-file-close_id.h [new file with mode: 0644]
level_0/f_file/tests/unit/c/test-file.c
level_0/f_file/tests/unit/c/test-file.h
level_0/f_socket/c/socket.c
level_0/f_socket/c/socket.h
level_0/f_socket/c/socket/common.h
level_0/f_socket/tests/unit/c/test-socket-accept.c