Commit Graph

9 Commits

Author SHA1 Message Date
Sean Bright 46afd61b75 test_http_media_cache.c: Fix copy/paste error during test deregistration.
Change-Id: I9a3a978b2f818be464e062d97b93831b127ef28c
2021-09-13 07:11:01 -05:00
Sean Bright d5bb27a06f res_http_media_cache.c: Fix merge errors from 18 -> master
ASTERISK-27871 #close

Change-Id: I6624f2d3a57f76a89bb372ef54a124929a0338d7
2021-07-19 12:38:25 -05:00
Sean Bright d568326807 res_http_media_cache.c: Parse media URLs to find extensions.
Use cURL's URL parsing API, falling back to the urlparser library, to
parse playback URLs in order to find their file extensions.

For backwards compatibility, we first look at the full URL, then at
any Content-Type header, and finally at just the path portion of the
URL.

ASTERISK-27871 #close

Change-Id: I16d0682f6d794be96539261b3e48f237909139cb
2021-07-19 06:53:50 -05:00
Alexander Traud b91fb3c396 loader: Sync load- and build-time deps.
In MODULEINFO, each depend has to be listed in .requires of AST_MODULE_INFO.

ASTERISK-29148

Change-Id: I254dd33194ae38d2877b8021c57c2a5deb6bbcd2
2020-11-20 13:51:02 -06:00
Corey Farrell 58fa3885cc Loader: Remove unneeded load_pri declarations.
Instead of specifying AST_MODFLAG_LOAD_ORDER with load_pri
AST_MODPRI_DEFAULT just use AST_MODFLAG_DEFAULT.

Change-Id: I0123258eafce324249433a69df15a85cc16e509f
2017-11-20 13:17:55 -06:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Mark Michelson 10019dc70c test_http_media_cache: Fix failing test.
The retrieve_cache_control_directives test has been failing occasionally
in Jenkins. The apparent failure occurs when attempting to validate the
expiration of the retrieved file.

After reproducing, the problem was pretty clear. At the beginning of the
test, the current time is retrieved. The seconds value of this timestamp
is X. When the file is retrieved, res_http_media_cache calculates the
expiration and in doing so retrieves the current time. In most cases,
since the test executes quickly, it will also retrieve a timestamp with
X seconds. However, if the test starts very near to when the timestamp
seconds are set to increment, res_http_media_cache may retrieve a
timestamp with X+1 seconds instead.

The test attempted to account for this by allowing a tolerance of 1
second when validating the expiration. However, the problem was that the
comparisons being used in the validation used > and < operations. This
meant that values that fell within the tolerance (because they equaled
the upper bound of the tolerance) would fail.

The solution is to use >= and <= operators in the expiration validation.

However, I estimated that while the one second tolerance should be
fine on most machines, it would still be possible on a very slow machine
to end up falling outside the one second tolerance. So I have also
relaxed the tolerance of expiration validation to be three seconds
instead.

The final change here is to add a debug message when validating
expiration so that we can see what values are being compared.

ASTERISK-25959 #close
Reported by Joshua Colp

Change-Id: Ic1a0e10722c1c5d276d5a4d6a67136d6ec26c247
2016-06-09 14:25:05 -05:00
Joshua Colp a72f3b5bb4 tests/test_http_media_cache: Fix file descriptor leak in test.
Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
2016-03-24 08:18:31 -03:00
Matt Jordan 01962a3932 tests/test_http_media_cache: Add unit tests for res_http_media_cache
This patch adds unit tests for res_http_media cache, that covers nominal
creation and retrieval - and through them as well, staleness and deletion
checks. In addition, this patch adds tests that covers the interaction of
various HTTP headers, including Expires, Etag, and Cache-Control.

ASTERISK-25654

Change-Id: I2db101e307c863857fe416d6f5bf4cace9ac7cf5
2016-03-23 13:53:31 -03:00