mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
[Core] Add PRE_CLOSED flag on file handle, add unit test.
This commit is contained in:
1 parent
5274dd1f9c
commit
b124b607d7
4 files changed
+140
-3
No files matched your search
@@ -915,6 +915,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_pre_close(switch_file_handle_t
|
||||
}
|
||||
|
||||
switch_clear_flag_locked(fh, SWITCH_FILE_OPEN);
|
||||
switch_set_flag_locked(fh, SWITCH_FILE_PRE_CLOSED);
|
||||
|
||||
if (fh->file_interface->file_pre_close) {
|
||||
status = fh->file_interface->file_pre_close(fh);
|
||||
@@ -929,10 +930,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
||||
|
||||
if (switch_test_flag(fh, SWITCH_FILE_OPEN)) {
|
||||
status = switch_core_file_pre_close(fh);
|
||||
} else {
|
||||
} else if (!switch_test_flag(fh, SWITCH_FILE_PRE_CLOSED)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_clear_flag_locked(fh, SWITCH_FILE_PRE_CLOSED);
|
||||
|
||||
fh->file_interface->file_close(fh);
|
||||
|
||||
if (fh->params) {
|
||||
|
||||
Reference in new issue
Block a user