diff --git a/docs/_static/zmstyle.css b/docs/_static/zmstyle.css new file mode 100644 index 000000000..b8f0235f3 --- /dev/null +++ b/docs/_static/zmstyle.css @@ -0,0 +1,3 @@ +img { + border: 1px solid black !important; + } diff --git a/docs/_static/zmstyles.css b/docs/_static/zmstyles.css deleted file mode 100644 index 8f59f3910..000000000 --- a/docs/_static/zmstyles.css +++ /dev/null @@ -1,13 +0,0 @@ -@import url("default.css"); - -div.admonition-note { -border-top: 2px solid red; -border-bottom: 2px solid red; -border-left: 2px solid red; -border-right: 2px solid red; -background-color: #ff6347 -} - -img { - border: 1px solid black !important; -} diff --git a/docs/conf.py b/docs/conf.py index 1e7f35737..109161b24 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,9 @@ import sys import os +def setup(app): + app.add_stylesheet('zmstyle.css') + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -98,14 +101,15 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +#html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = { - "stickysidebar": "true" -} +#html_theme_options = { +# "stickysidebar": "true" +#} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] @@ -130,7 +134,7 @@ html_theme_options = { # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_style='zmstyles.css' +#html_style='zmstyles.css' # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index 608311649..8ac4a51ba 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -71,7 +71,7 @@ void RemoteCamera::Initialise() } mNeedAuth = false; - mAuthenticator = new Authenticator(username,password); + mAuthenticator = new zm::Authenticator(username,password); struct addrinfo hints; memset(&hints, 0, sizeof(hints)); diff --git a/src/zm_remote_camera.h b/src/zm_remote_camera.h index 44c00bf65..7e3ae79a8 100644 --- a/src/zm_remote_camera.h +++ b/src/zm_remote_camera.h @@ -50,7 +50,7 @@ protected: // fill required fields and set needAuth // subsequent requests can set the required authentication header. bool mNeedAuth; - Authenticator* mAuthenticator; + zm::Authenticator* mAuthenticator; protected: struct addrinfo *hp; diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 44004564f..440c24e05 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -306,7 +306,7 @@ int RemoteCameraHttp::GetResponse() std::string Header = header; mAuthenticator->checkAuthResponse(Header); - if ( mAuthenticator->auth_method() == AUTH_DIGEST ) { + if ( mAuthenticator->auth_method() == zm::AUTH_DIGEST ) { Debug( 2, "Need Digest Authentication" ); request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); @@ -750,7 +750,7 @@ Debug(3, "Need more data buffer %d < content length %d", buffer.size(), content_ Debug(2, "Checking for digest auth in %s", authenticate_header ); mAuthenticator->checkAuthResponse(Header); - if ( mAuthenticator->auth_method() == AUTH_DIGEST ) { + if ( mAuthenticator->auth_method() == zm::AUTH_DIGEST ) { Debug( 2, "Need Digest Authentication" ); request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); diff --git a/src/zm_rtsp.cpp b/src/zm_rtsp.cpp index 0dbcb7329..7ac80e9b6 100644 --- a/src/zm_rtsp.cpp +++ b/src/zm_rtsp.cpp @@ -203,9 +203,9 @@ RtspThread::RtspThread( int id, RtspMethod method, const std::string &protocol, mNeedAuth = false; StringVector parts = split(auth,":"); if (parts.size() > 1) - mAuthenticator = new Authenticator(parts[0], parts[1]); + mAuthenticator = new zm::Authenticator(parts[0], parts[1]); else - mAuthenticator = new Authenticator(parts[0], ""); + mAuthenticator = new zm::Authenticator(parts[0], ""); } RtspThread::~RtspThread() diff --git a/src/zm_rtsp.h b/src/zm_rtsp.h index acd28e651..192200d0b 100644 --- a/src/zm_rtsp.h +++ b/src/zm_rtsp.h @@ -66,7 +66,7 @@ private: // subsequent requests can set the required authentication header. bool mNeedAuth; int respCode; - Authenticator* mAuthenticator; + zm::Authenticator* mAuthenticator; std::string mHttpSession; ///< Only for RTSP over HTTP sessions diff --git a/src/zm_rtsp_auth.cpp b/src/zm_rtsp_auth.cpp index fd9087afa..10ecf3475 100644 --- a/src/zm_rtsp_auth.cpp +++ b/src/zm_rtsp_auth.cpp @@ -24,6 +24,8 @@ #include #include +namespace zm { + Authenticator::Authenticator(std::string &username, std::string password) { #ifdef HAVE_GCRYPT_H // Special initialisation for libgcrypt @@ -227,3 +229,5 @@ void Authenticator::checkAuthResponse(std::string &response) { Debug( 2, "Didn't find auth line in %s", authLine.c_str()); } } + +} // namespace zm diff --git a/src/zm_rtsp_auth.h b/src/zm_rtsp_auth.h index 23745f9c7..079dec639 100644 --- a/src/zm_rtsp_auth.h +++ b/src/zm_rtsp_auth.h @@ -32,6 +32,8 @@ #include #endif // HAVE_GCRYPT_H || HAVE_LIBCRYPTO +namespace zm { + enum AuthMethod { AUTH_UNDEFINED = 0, AUTH_BASIC = 1, AUTH_DIGEST = 2 }; class Authenticator { public: @@ -62,4 +64,6 @@ private: int nc; }; +} // namespace zm + #endif // ZM_RTSP_AUTH_H