[vlc-devel] [PATCH 6/9] httpd: Expose the server port

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Sep 2 15:47:28 CEST 2020


---
 include/vlc_httpd.h | 2 ++
 src/libvlccore.sym  | 1 +
 src/network/httpd.c | 5 +++++
 3 files changed, 8 insertions(+)

diff --git a/include/vlc_httpd.h b/include/vlc_httpd.h
index 0b8f8c26bd..5c91561fa5 100644
--- a/include/vlc_httpd.h
+++ b/include/vlc_httpd.h
@@ -148,4 +148,6 @@ VLC_API void httpd_MsgAdd( httpd_message_t *, const char *psz_name, const char *
 /* return "" if not found. The string is not allocated */
 VLC_API const char * httpd_MsgGet( const httpd_message_t *, const char *psz_name );
 
+VLC_API unsigned int httpd_ServerPort( const httpd_host_t* );
+
 #endif /* _VLC_HTTPD_H */
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index b0aa359603..d3112ce5e6 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -155,6 +155,7 @@ httpd_MsgGet
 httpd_RedirectDelete
 httpd_RedirectNew
 httpd_ServerIP
+httpd_ServerPort
 httpd_StreamDelete
 httpd_StreamHeader
 httpd_StreamNew
diff --git a/src/network/httpd.c b/src/network/httpd.c
index e11c9aab99..801ace8364 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -1167,6 +1167,11 @@ const char *httpd_MsgGet(const httpd_message_t *msg, const char *name)
     return NULL;
 }
 
+unsigned int httpd_ServerPort( const httpd_host_t* host )
+{
+    return host->port;
+}
+
 void httpd_MsgAdd(httpd_message_t *msg, const char *name, const char *psz_value, ...)
 {
     httpd_header *p_tmp = realloc(msg->p_headers, sizeof(httpd_header) * (msg->i_headers + 1));
-- 
2.20.1



More information about the vlc-devel mailing list