This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 8d1f2d5 system: nxplayer: Introduce max host and file name for http
url
8d1f2d5 is described below
commit 8d1f2d52dae49b6acc0977158c4b846b2c1c6057
Author: Masayuki Ishikawa <[email protected]>
AuthorDate: Thu May 21 11:29:45 2020 +0900
system: nxplayer: Introduce max host and file name for http url
Signed-off-by: Masayuki Ishikawa <[email protected]>
---
system/nxplayer/Kconfig | 12 ++++++++++++
system/nxplayer/nxplayer.c | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/system/nxplayer/Kconfig b/system/nxplayer/Kconfig
index 3a7ac36..d448c6d 100644
--- a/system/nxplayer/Kconfig
+++ b/system/nxplayer/Kconfig
@@ -129,3 +129,15 @@ config NXPLAYER_HTTP_STREAMING_SUPPORT
audio streaming as well as local file playback.
endif
+
+if NXPLAYER_HTTP_STREAMING_SUPPORT
+
+config NXPLAYER_HTTP_MAXHOSTNAME
+ int "Max host name in URL"
+ default 40
+
+config NXPLAYER_HTTP_MAXFILENAME
+ int "Max file name in URL"
+ default 100
+
+endif
diff --git a/system/nxplayer/nxplayer.c b/system/nxplayer/nxplayer.c
index 1f9046d..3ac5d4c 100644
--- a/system/nxplayer/nxplayer.c
+++ b/system/nxplayer/nxplayer.c
@@ -171,8 +171,8 @@ static const int g_known_ext_count = sizeof(g_known_ext) /
static int _open_with_http(const char *fullurl)
{
- char relurl[32];
- char hostname[32];
+ char relurl[CONFIG_NXPLAYER_HTTP_MAXFILENAME];
+ char hostname[CONFIG_NXPLAYER_HTTP_MAXHOSTNAME];
int resp_chk = 0;
char resp_msg[] = "\r\n\r\n";
struct timeval tv;