Skip to content

Commit

Permalink
[mod_curl] SWITCH_STANDARD_API need to return true
Browse files Browse the repository at this point in the history
I also added logging if there was an error opening the file.
  • Loading branch information
greenbea authored Jan 17, 2023
1 parent 4b35096 commit b875833
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/mod/applications/mod_curl/mod_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ SWITCH_STANDARD_APP(http_sendfile_app_function)
#define HTTP_SENDFILE_SYNTAX "<url> <filenameParamName=filepath> [nopost|postparam1=foo&postparam2=bar... [event|stream|both|none [identifier ]]]"
SWITCH_STANDARD_API(http_sendfile_function)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_bool_t new_memory_pool = SWITCH_FALSE;
char *argv[10] = { 0 }, *argv2[10] = { 0 };
int argc = 0, argc2 = 0;
Expand All @@ -712,7 +711,6 @@ SWITCH_STANDARD_API(http_sendfile_function)

if(zstr(cmd))
{
status = SWITCH_STATUS_SUCCESS;
goto http_sendfile_usage;
}
if(session)
Expand Down Expand Up @@ -741,7 +739,6 @@ SWITCH_STANDARD_API(http_sendfile_function)

if (argc < 2 || argc > 5)
{
status = SWITCH_STATUS_SUCCESS;
goto http_sendfile_usage;
}

Expand Down Expand Up @@ -794,6 +791,7 @@ SWITCH_STANDARD_API(http_sendfile_function)

// We need to check the file now...
if(http_sendfile_test_file_open(http_data, event) != SWITCH_STATUS_SUCCESS)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open file '%s'\n", http_data->filename_element);
goto http_sendfile_done;


Expand All @@ -805,7 +803,6 @@ SWITCH_STANDARD_API(http_sendfile_function)

http_sendfile_success_report(http_data, event);

status = SWITCH_STATUS_SUCCESS;
goto http_sendfile_done;

http_sendfile_usage:
Expand All @@ -823,7 +820,7 @@ SWITCH_STANDARD_API(http_sendfile_function)
switch_core_destroy_memory_pool(&pool);
}

return status;
return SWITCH_STATUS_SUCCESS;
}

SWITCH_STANDARD_APP(curl_app_function)
Expand Down

0 comments on commit b875833

Please sign in to comment.