diff --git a/NT/elogd.sln b/NT/elogd.sln index f3aea9d9..2fcfe4a8 100755 --- a/NT/elogd.sln +++ b/NT/elogd.sln @@ -17,7 +17,6 @@ Global {8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Debug|Win32.ActiveCfg = Debug|Win32 {8D6EBED8-48F3-4719-907E-7BE46A3C0FA4}.Release|Win32.ActiveCfg = Release|Win32 {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.ActiveCfg = Debug|Win32 - {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Debug|Win32.Build.0 = Debug|Win32 {FD6FCAF3-A94B-40FA-AE52-07705DE2E519}.Release|Win32.ActiveCfg = Release|Win32 {CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.ActiveCfg = Debug|Win32 {CB6EB7FE-CC3D-4548-B8B8-8DDA05916759}.Debug|Win32.Build.0 = Debug|Win32 diff --git a/NT/elogd.vcproj b/NT/elogd.vcproj index b240b873..c3629cf8 100755 --- a/NT/elogd.vcproj +++ b/NT/elogd.vcproj @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="\mxml;\openssl\include;" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_SSL1" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_SSL" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/src/elogd.c b/src/elogd.c index 9cf0efd4..dd1950e2 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -132,7 +132,7 @@ char pidfile[256]; /* Pidfile name #include "strlcpy.h" BOOL running_as_daemon; /* Running as a daemon/service? */ -int elog_tcp_port = (int) DEFAULT_PORT; /* Server's TCP port */ +int elog_tcp_port; /* Server's TCP port */ static void (*printf_handler) (const char *); /* Handler to printf for logging */ static void (*fputs_handler) (const char *); /* Handler to fputs for logging */ @@ -6162,9 +6162,12 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) else sprintf(hattrib, "%s", attrib + 5); - } else if (strstr(attrib, "://") == 0 && attrib[0] != '#') /* add http:// if missing */ - sprintf(hattrib, "http://%s", attrib); - else + } else if (strstr(attrib, "://") == 0 && attrib[0] != '#') { /* add http:// if missing */ + if (_ssl_flag) + sprintf(hattrib, "https://%s", attrib); + else + sprintf(hattrib, "http://%s", attrib); + } else strlcpy(hattrib, attrib, sizeof(hattrib)); strextract(str + i, '[', value, sizeof(value)); @@ -6213,11 +6216,15 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) } /* add http:// if missing */ - else if (!strnieq(attrib, "http://", 7) && + else if ((!strnieq(attrib, "http://", 7) && !strnieq(attrib, "https://", 8)) && strstr(pattern_list[l].subst, "mailto") == NULL && strstr(pattern_list[l].subst, "img") == NULL && - strncmp(pattern_list[l].subst, "http://midas.psi.ch/elog/config.html\n"); + rsprintf("https://midas.psi.ch/elog/config.html\">https://midas.psi.ch/elog/config.html\n"); rsprintf(".\n"); rsprintf("\n\n"); rsprintf("