From 29fc49199d3c42e1df9fc2ba0ba7bf40635f19e0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 31 Jul 2019 14:29:18 -0500 Subject: [PATCH 01/21] Update versions after tag, set DEVELOPMENT_FLAG/DEV_SNAPSHOT --- configure/CONFIG_BASE_VERSION | 10 +++++----- modules/ca/configure/CONFIG_CA_VERSION | 12 ++++++++++-- modules/database/configure/CONFIG_DATABASE_VERSION | 12 ++++++++++-- modules/libcom/configure/CONFIG_LIBCOM_VERSION | 12 ++++++++++-- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION index 53753d7e4..4e61e48cd 100644 --- a/configure/CONFIG_BASE_VERSION +++ b/configure/CONFIG_BASE_VERSION @@ -52,12 +52,12 @@ EPICS_MODIFICATION = 3 # EPICS_PATCH_LEVEL must be a number (win32 resource file requirement) # Not included in the official EPICS version number if zero -EPICS_PATCH_LEVEL = 0 +EPICS_PATCH_LEVEL = 1 -# Between official releases, the EPICS_PATCH_LEVEL gets incremented -# and a -DEV suffix is added (similar to the Maven -SNAPSHOT versions) -EPICS_DEV_SNAPSHOT= -#EPICS_DEV_SNAPSHOT=-DEV +# Immediately after an official release the EPICS_PATCH_LEVEL is incremented +# and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions) +#EPICS_DEV_SNAPSHOT= +EPICS_DEV_SNAPSHOT=-DEV #EPICS_DEV_SNAPSHOT=-pre1 #EPICS_DEV_SNAPSHOT=-pre1-DEV #EPICS_DEV_SNAPSHOT=-pre2 diff --git a/modules/ca/configure/CONFIG_CA_VERSION b/modules/ca/configure/CONFIG_CA_VERSION index 8a6649666..cac0fcbfe 100644 --- a/modules/ca/configure/CONFIG_CA_VERSION +++ b/modules/ca/configure/CONFIG_CA_VERSION @@ -1,4 +1,12 @@ +# Version number for the Channel Access API and shared library + EPICS_CA_MAJOR_VERSION = 4 EPICS_CA_MINOR_VERSION = 13 -EPICS_CA_MAINTENANCE_VERSION = 4 -EPICS_CA_DEVELOPMENT_FLAG = 0 +EPICS_CA_MAINTENANCE_VERSION = 5 + +# Development flag, must be zero for official release versions + +EPICS_CA_DEVELOPMENT_FLAG = 1 + +# Immediately after an official release the MAINTENANCE_VERSION +# will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/modules/database/configure/CONFIG_DATABASE_VERSION b/modules/database/configure/CONFIG_DATABASE_VERSION index ad8d54ab5..a43738cfb 100644 --- a/modules/database/configure/CONFIG_DATABASE_VERSION +++ b/modules/database/configure/CONFIG_DATABASE_VERSION @@ -1,4 +1,12 @@ +# Version number for the database APIs and shared library + EPICS_DATABASE_MAJOR_VERSION = 3 EPICS_DATABASE_MINOR_VERSION = 17 -EPICS_DATABASE_MAINTENANCE_VERSION = 4 -EPICS_DATABASE_DEVELOPMENT_FLAG = 0 +EPICS_DATABASE_MAINTENANCE_VERSION = 5 + +# Development flag, must be zero for official release versions + +EPICS_DATABASE_DEVELOPMENT_FLAG = 1 + +# Immediately after an official release the MAINTENANCE_VERSION +# will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/modules/libcom/configure/CONFIG_LIBCOM_VERSION b/modules/libcom/configure/CONFIG_LIBCOM_VERSION index f5d91037c..92c374f88 100644 --- a/modules/libcom/configure/CONFIG_LIBCOM_VERSION +++ b/modules/libcom/configure/CONFIG_LIBCOM_VERSION @@ -1,4 +1,12 @@ +# Version number for the libcom APIs and shared library + EPICS_LIBCOM_MAJOR_VERSION = 3 EPICS_LIBCOM_MINOR_VERSION = 17 -EPICS_LIBCOM_MAINTENANCE_VERSION = 5 -EPICS_LIBCOM_DEVELOPMENT_FLAG = 0 +EPICS_LIBCOM_MAINTENANCE_VERSION = 6 + +# Development flag, must be zero for official release versions + +EPICS_LIBCOM_DEVELOPMENT_FLAG = 1 + +# Immediately after an official release the MAINTENANCE_VERSION +# will be incremented and the DEVELOPMENT_FLAG set to 1 From 969ffa3598ff36738328afec78882f6e751377ee Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 31 Jul 2019 14:34:42 -0500 Subject: [PATCH 02/21] Checklist: Update version update instructions --- documentation/ReleaseChecklist.html | 52 +++++++++++++++++------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html index 81784e8cc..a29552dc2 100644 --- a/documentation/ReleaseChecklist.html +++ b/documentation/ReleaseChecklist.html @@ -289,13 +289,20 @@ starting at Release Approval.

Release Manager Edit and commit changes to the EPICS Base version number file and - the embedded module version files: + these embedded module version files: + +

Version numbers should be set according to the level of changes + made since the last release. Note that the MAINTENANCE_VERSION or + PATCH_LEVEL value should have been incremented after the previous + release tag was applied.

+

Set all DEVELOPMENT_FLAG values to 0 and EPICS_DEV_SNAPSHOT to the + empty string.

+ @@ -305,7 +312,26 @@ starting at Release Approval.

cd base-7.0
git tag -m 'ANJ: Tagged for 7.0.3' R7.0.3 - Don't push the new tag to the Launchpad repository yet. +

Don't push these commits or the new tag to the Launchpad repository + yet. + + + + Release Manager + Edit and commit changes to the EPICS Base version number file and + the embedded module version files as follows: +

+

Version numbers should be set for the next expected patch/maintenance + release by incrementing the MAINTENANCE_VERSION or PATCH_LEVEL + value in each file.

+

Set all DEVELOPMENT_FLAG values to 1 and EPICS_DEV_SNAPSHOT to + "-DEV".

+ @@ -327,29 +353,13 @@ starting at Release Approval.

Release Manager Test the tar file by extracting its contents and building it on at - least one supported platform. When this succeeds the new git tag can be - pushed to the Launchpad repository: + least one supported platform. When this succeeds the commits and new git + tag can be pushed to the Launchpad repository:
git push --follow-tags upstream 7.0
- - - Release Manager - Edit and commit changes to the EPICS Base version number file and - the embedded module version files: - - Version numbers should be set to the next expected patch release, - with a "-DEV" tag added (where applicable). - - - Publish to epics.anl.gov From e0039d4e86431a682209e19e410f164441ebb225 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 1 Aug 2019 16:20:53 -0500 Subject: [PATCH 03/21] Expand epics-controls publication instructions --- documentation/ReleaseChecklist.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html index a29552dc2..7c58a61d2 100644 --- a/documentation/ReleaseChecklist.html +++ b/documentation/ReleaseChecklist.html @@ -408,7 +408,11 @@ starting at Release Approval.

Website Manager Upload the tar file and its .asc signature file to the - epics-controls web-server [ToDo: ssh-key, location] + epics-controls web-server. +
+ scp base-7.0.3.tar.gz base-7.0.3.tar.gz.asc epics-controls:download/base
+
+ @@ -416,7 +420,10 @@ starting at Release Approval.

Follow instructions on Add a page for a new release to create a new release webpage (not - required for a patch release though, just edit the existing page). + required for a patch release, just edit the existing page). Update the + TablePress "Point Releases" table and add the new download, and adjust + the XYZ Html Snippet for the series download. + From fd48ee9aeced4096a96a8ba310ac19980e688524 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 13 Aug 2019 11:21:26 -0500 Subject: [PATCH 04/21] Update submodules Adjust comments in the embedded module CONFIG_*_VERSION files --- modules/ca/configure/CONFIG_CA_VERSION | 4 ++-- modules/database/configure/CONFIG_DATABASE_VERSION | 4 ++-- modules/libcom/configure/CONFIG_LIBCOM_VERSION | 4 ++-- modules/normativeTypes | 2 +- modules/pvAccess | 2 +- modules/pvData | 2 +- modules/pvDatabase | 2 +- modules/pva2pva | 2 +- modules/pvaClient | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/ca/configure/CONFIG_CA_VERSION b/modules/ca/configure/CONFIG_CA_VERSION index cac0fcbfe..57bcd89ac 100644 --- a/modules/ca/configure/CONFIG_CA_VERSION +++ b/modules/ca/configure/CONFIG_CA_VERSION @@ -4,9 +4,9 @@ EPICS_CA_MAJOR_VERSION = 4 EPICS_CA_MINOR_VERSION = 13 EPICS_CA_MAINTENANCE_VERSION = 5 -# Development flag, must be zero for official release versions +# Development flag, set to zero for release versions EPICS_CA_DEVELOPMENT_FLAG = 1 -# Immediately after an official release the MAINTENANCE_VERSION +# Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/modules/database/configure/CONFIG_DATABASE_VERSION b/modules/database/configure/CONFIG_DATABASE_VERSION index a43738cfb..ebf04180a 100644 --- a/modules/database/configure/CONFIG_DATABASE_VERSION +++ b/modules/database/configure/CONFIG_DATABASE_VERSION @@ -4,9 +4,9 @@ EPICS_DATABASE_MAJOR_VERSION = 3 EPICS_DATABASE_MINOR_VERSION = 17 EPICS_DATABASE_MAINTENANCE_VERSION = 5 -# Development flag, must be zero for official release versions +# Development flag, set to zero for release versions EPICS_DATABASE_DEVELOPMENT_FLAG = 1 -# Immediately after an official release the MAINTENANCE_VERSION +# Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/modules/libcom/configure/CONFIG_LIBCOM_VERSION b/modules/libcom/configure/CONFIG_LIBCOM_VERSION index 92c374f88..5953c7175 100644 --- a/modules/libcom/configure/CONFIG_LIBCOM_VERSION +++ b/modules/libcom/configure/CONFIG_LIBCOM_VERSION @@ -4,9 +4,9 @@ EPICS_LIBCOM_MAJOR_VERSION = 3 EPICS_LIBCOM_MINOR_VERSION = 17 EPICS_LIBCOM_MAINTENANCE_VERSION = 6 -# Development flag, must be zero for official release versions +# Development flag, set to zero for release versions EPICS_LIBCOM_DEVELOPMENT_FLAG = 1 -# Immediately after an official release the MAINTENANCE_VERSION +# Immediately after a release the MAINTENANCE_VERSION # will be incremented and the DEVELOPMENT_FLAG set to 1 diff --git a/modules/normativeTypes b/modules/normativeTypes index c6168a747..ba33c7443 160000 --- a/modules/normativeTypes +++ b/modules/normativeTypes @@ -1 +1 @@ -Subproject commit c6168a74772a93f18facc83631c13db381ff15bb +Subproject commit ba33c7443c52689641c2a7377e39544d5dd326d2 diff --git a/modules/pvAccess b/modules/pvAccess index 936f5d35d..c8c3cf4fd 160000 --- a/modules/pvAccess +++ b/modules/pvAccess @@ -1 +1 @@ -Subproject commit 936f5d35d845a3c47a55176876a0f607a582cf09 +Subproject commit c8c3cf4fd8b3490221c1e231c354e73735ee3813 diff --git a/modules/pvData b/modules/pvData index 6ceaa6adb..b903df5d0 160000 --- a/modules/pvData +++ b/modules/pvData @@ -1 +1 @@ -Subproject commit 6ceaa6adb0b39dc3e37f064ca7e7bb5eea459d96 +Subproject commit b903df5d0daf08592368be2978efb2d828617a8c diff --git a/modules/pvDatabase b/modules/pvDatabase index 70ee85778..d7bd5628d 160000 --- a/modules/pvDatabase +++ b/modules/pvDatabase @@ -1 +1 @@ -Subproject commit 70ee85778268bb47397d4cf8aa07e019ccdd8392 +Subproject commit d7bd5628d47f82b2ad2cab2ea97dade98c2ee128 diff --git a/modules/pva2pva b/modules/pva2pva index ce39c9320..d70a2ff8c 160000 --- a/modules/pva2pva +++ b/modules/pva2pva @@ -1 +1 @@ -Subproject commit ce39c932013e3af1d4750394ee69ba20bd13fa74 +Subproject commit d70a2ff8c31bc042477b4997d733b77e6029e8f9 diff --git a/modules/pvaClient b/modules/pvaClient index aba40922e..246cceae3 160000 --- a/modules/pvaClient +++ b/modules/pvaClient @@ -1 +1 @@ -Subproject commit aba40922e6a96519c214c7644bfdf49a8bd0d7f6 +Subproject commit 246cceae3e682ac99413673195fec07dffa77267 From 05cd95a8212551aa0d6205093ea1e2ac9fcdc128 Mon Sep 17 00:00:00 2001 From: Zimoch Dirk Date: Tue, 13 Aug 2019 20:35:05 -0700 Subject: [PATCH 05/21] astac argument checks --- modules/database/src/ioc/as/asDbLib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/database/src/ioc/as/asDbLib.c b/modules/database/src/ioc/as/asDbLib.c index c0fe192b0..49be480bc 100644 --- a/modules/database/src/ioc/as/asDbLib.c +++ b/modules/database/src/ioc/as/asDbLib.c @@ -240,6 +240,10 @@ int astac(const char *pname,const char *user,const char *location) char *puser; char *plocation; + if (!pname || !user || !location){ + printf("Usage: astac \"record name\", \"user\", \"host\"\n"); + return(1); + } paddr = dbCalloc(1,sizeof(DBADDR) + sizeof(ASCLIENTPVT)); pasclientpvt = (ASCLIENTPVT *)(paddr + 1); status=dbNameToAddr(pname,paddr); From b2938459f8003cd5ed1484603e228d73afbe0d9b Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 28 Aug 2019 15:28:08 -0500 Subject: [PATCH 06/21] Define pdevLibVME on non-VME RTEMS targets --- documentation/RELEASE_NOTES.html | 14 +++++++++++++- modules/libcom/src/osi/os/RTEMS/devLibVMEOSD.c | 7 ++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 103e5a957..10910080d 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -20,7 +20,7 @@ release.

which should also be read to understand what has changed since an earlier release.

-

EPICS Release 7.0.3

+

EPICS Release 7.0.3.1

+

Non-VME RTEMS targets now define pdevLibVME

+ +

Previously IOC executables that made calls to devLib routines would fail to +link when built for some non-VME based RTEMS targets, which would have to be +explicitly filtered out by sites that build Base for those targets. +This fix makes +that no longer necessary, all RTEMS targets should now link although the IOC +won't be able to be used with the VME I/O on those systems (that we don't have +VMEbus I/O support for in libCom).

+ +

EPICS Release 7.0.3

+

epicsTimeGetCurrent() optimization

Add a fast path to epicsTimeGetCurrent() and related calls diff --git a/modules/libcom/src/osi/os/RTEMS/devLibVMEOSD.c b/modules/libcom/src/osi/os/RTEMS/devLibVMEOSD.c index 0a96bad1a..b8f79e706 100644 --- a/modules/libcom/src/osi/os/RTEMS/devLibVMEOSD.c +++ b/modules/libcom/src/osi/os/RTEMS/devLibVMEOSD.c @@ -350,7 +350,12 @@ static void unsolicitedHandlerEPICS(int vectorNumber) ); } -#endif /* defined(__PPC__) && defined(mpc750) */ +#else /* !defined(__PPC__) && !defined(__mcf528x__) */ + +/* No known VME interface here, provide a dummy */ +devLibVME *pdevLibVME; + +#endif /* defined(__PPC__) || defined(__mcf528x__) */ /* * Some vxWorks convenience routines From 62c3b0a585a4abcaae7794e487627bea29712be8 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 27 Aug 2019 16:51:00 +0200 Subject: [PATCH 07/21] don't send errlog on all logClients --- modules/libcom/src/log/iocLog.c | 14 ++++++++++++++ modules/libcom/src/log/logClient.c | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/libcom/src/log/iocLog.c b/modules/libcom/src/log/iocLog.c index e62da2050..8cb1349a1 100644 --- a/modules/libcom/src/log/iocLog.c +++ b/modules/libcom/src/log/iocLog.c @@ -18,8 +18,10 @@ #define epicsExportSharedSymbols #include "envDefs.h" +#include "errlog.h" #include "logClient.h" #include "iocLog.h" +#include "epicsExit.h" int iocLogDisable = 0; @@ -74,6 +76,14 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void) } } +/* + * logClientDestroy() + */ +static void iocLogClientDestroy (logClientId id) +{ + errlogRemoveListeners (logClientSendMessage, id); +} + /* * iocLogClientInit() */ @@ -89,6 +99,10 @@ static logClientId iocLogClientInit (void) return NULL; } id = logClientCreate (addr, port); + if (id != NULL) { + errlogAddListener (logClientSendMessage, id); + epicsAtExit (iocLogClientDestroy, id); + } return id; } diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 99ee671d9..b076d50cb 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -154,8 +154,6 @@ static void logClientDestroy (logClientId id) return; } - errlogRemoveListeners ( logClientSendMessage, (void *) pClient ); - logClientClose ( pClient ); epicsMutexDestroy ( pClient->mutex ); @@ -549,8 +547,6 @@ logClientId epicsShareAPI logClientCreate ( pClient->name, LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT ); } - errlogAddListener ( logClientSendMessage, (void *) pClient ); - return (void *) pClient; } From 243287877311748057baa61937ea8d8a530f8d27 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 27 Aug 2019 17:34:01 +0200 Subject: [PATCH 08/21] speed up logRestart thread termination at exit --- modules/libcom/src/log/logClient.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index b076d50cb..96382a2eb 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -44,6 +44,7 @@ typedef struct { SOCKET sock; epicsThreadId restartThreadId; epicsEventId stateChangeNotify; + epicsEventId shutdownNotify; unsigned connectCount; unsigned nextMsgIndex; unsigned connected; @@ -113,6 +114,7 @@ static void logClientDestroy (logClientId id) epicsMutexMustLock ( pClient->mutex ); pClient->shutdown = 1u; epicsMutexUnlock ( pClient->mutex ); + epicsEventSignal ( pClient->shutdownNotify ); /* unblock log client thread blocking in send() or connect() */ interruptInfo = @@ -157,8 +159,8 @@ static void logClientDestroy (logClientId id) logClientClose ( pClient ); epicsMutexDestroy ( pClient->mutex ); - epicsEventDestroy ( pClient->stateChangeNotify ); + epicsEventDestroy ( pClient->shutdownNotify ); free ( pClient ); } @@ -461,8 +463,8 @@ static void logClientRestart ( logClientId id ) else { logClientConnect ( pClient ); } - - epicsThreadSleep ( LOG_RESTART_DELAY ); + + epicsEventWaitWithTimeout ( pClient->shutdownNotify, LOG_RESTART_DELAY); epicsMutexMustLock ( pClient->mutex ); } @@ -505,14 +507,22 @@ logClientId epicsShareAPI logClientCreate ( pClient->shutdownConfirm = 0; epicsAtExit (logClientDestroy, (void*) pClient); - + pClient->stateChangeNotify = epicsEventCreate (epicsEventEmpty); if ( ! pClient->stateChangeNotify ) { epicsMutexDestroy ( pClient->mutex ); free ( pClient ); return NULL; } - + + pClient->shutdownNotify = epicsEventCreate (epicsEventEmpty); + if ( ! pClient->shutdownNotify ) { + epicsMutexDestroy ( pClient->mutex ); + epicsEventDestroy ( pClient->stateChangeNotify ); + free ( pClient ); + return NULL; + } + pClient->restartThreadId = epicsThreadCreate ( "logRestart", epicsThreadPriorityLow, epicsThreadGetStackSize(epicsThreadStackSmall), @@ -520,6 +530,7 @@ logClientId epicsShareAPI logClientCreate ( if ( pClient->restartThreadId == NULL ) { epicsMutexDestroy ( pClient->mutex ); epicsEventDestroy ( pClient->stateChangeNotify ); + epicsEventDestroy ( pClient->shutdownNotify ); free (pClient); fprintf(stderr, "log client: unable to start log client connection watch dog thread\n"); return NULL; From 0a3427c835e367792dd3419bc2a5bc1aea02386a Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 28 Aug 2019 09:29:57 +0200 Subject: [PATCH 09/21] do not discard unsent messages when log server has closed connection, instead try to send them after reconnect --- modules/libcom/src/log/logClient.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 96382a2eb..75984404c 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -85,8 +85,6 @@ static void logClientClose ( logClient *pClient ) pClient->sock = INVALID_SOCKET; } - pClient->nextMsgIndex = 0u; - memset ( pClient->msgBuf, '\0', sizeof ( pClient->msgBuf ) ); pClient->connected = 0u; /* From 709208ef5cd4db2764875175aacd94fd500e984a Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 28 Aug 2019 11:41:12 +0200 Subject: [PATCH 10/21] elimitate duplicate code in logClient --- modules/libcom/src/log/logClient.c | 62 +++++++----------------------- 1 file changed, 14 insertions(+), 48 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 75984404c..90fde98b5 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -174,57 +174,23 @@ static void sendMessageChunk(logClient * pClient, const char * message) { unsigned msgBufBytesLeft = sizeof ( pClient->msgBuf ) - pClient->nextMsgIndex; - if ( strSize > msgBufBytesLeft ) { - int status; - - if ( ! pClient->connected ) { - break; - } - - if ( msgBufBytesLeft > 0u ) { - memcpy ( & pClient->msgBuf[pClient->nextMsgIndex], - message, msgBufBytesLeft ); - pClient->nextMsgIndex += msgBufBytesLeft; - strSize -= msgBufBytesLeft; - message += msgBufBytesLeft; - } - - status = send ( pClient->sock, pClient->msgBuf, - pClient->nextMsgIndex, 0 ); - if ( status > 0 ) { - unsigned nSent = (unsigned) status; - if ( nSent < pClient->nextMsgIndex ) { - unsigned newNextMsgIndex = pClient->nextMsgIndex - nSent; - memmove ( pClient->msgBuf, & pClient->msgBuf[nSent], - newNextMsgIndex ); - pClient->nextMsgIndex = newNextMsgIndex; - } - else { - pClient->nextMsgIndex = 0u; - } - } - else { - if ( ! pClient->shutdown ) { - char sockErrBuf[64]; - if ( status ) { - epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - } - else { - strcpy ( sockErrBuf, "server initiated disconnect" ); - } - fprintf ( stderr, "log client: lost contact with log server at \"%s\" because \"%s\"\n", - pClient->name, sockErrBuf ); - } - logClientClose ( pClient ); - break; - } + if ( msgBufBytesLeft < strSize && pClient->nextMsgIndex != 0u && pClient->connected) + { + /* buffer is full, thus flush it */ + logClientFlush ( pClient ); + msgBufBytesLeft = sizeof ( pClient->msgBuf ) - pClient->nextMsgIndex; } - else { - memcpy ( & pClient->msgBuf[pClient->nextMsgIndex], - message, strSize ); - pClient->nextMsgIndex += strSize; + if ( msgBufBytesLeft == 0u ) { + fprintf ( stderr, "log client: messages to \"%s\" are lost\n", + pClient->name ); break; } + if ( msgBufBytesLeft > strSize) msgBufBytesLeft = strSize; + memcpy ( & pClient->msgBuf[pClient->nextMsgIndex], + message, msgBufBytesLeft ); + pClient->nextMsgIndex += msgBufBytesLeft; + strSize -= msgBufBytesLeft; + message += msgBufBytesLeft; } } From 59aa9cfe746b3fc08d7b94b82f47973f6c5ed92c Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 28 Aug 2019 15:15:19 +0200 Subject: [PATCH 11/21] avoid needless memmove calls --- modules/libcom/src/log/logClient.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 90fde98b5..203f29dd3 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -219,6 +219,8 @@ void epicsShareAPI logClientSend ( logClientId id, const char * message ) void epicsShareAPI logClientFlush ( logClientId id ) { + unsigned nSent = 0u; + logClient * pClient = ( logClient * ) id; if ( ! pClient ) { @@ -227,20 +229,11 @@ void epicsShareAPI logClientFlush ( logClientId id ) epicsMutexMustLock ( pClient->mutex ); - while ( pClient->nextMsgIndex && pClient->connected ) { - int status = send ( pClient->sock, pClient->msgBuf, - pClient->nextMsgIndex, 0 ); + while ( nSent < pClient->nextMsgIndex && pClient->connected ) { + int status = send ( pClient->sock, pClient->msgBuf + nSent, + pClient->nextMsgIndex - nSent, 0 ); if ( status > 0 ) { - unsigned nSent = (unsigned) status; - if ( nSent < pClient->nextMsgIndex ) { - unsigned newNextMsgIndex = pClient->nextMsgIndex - nSent; - memmove ( pClient->msgBuf, & pClient->msgBuf[nSent], - newNextMsgIndex ); - pClient->nextMsgIndex = newNextMsgIndex; - } - else { - pClient->nextMsgIndex = 0u; - } + nSent += (unsigned) status; } else { if ( ! pClient->shutdown ) { @@ -258,6 +251,11 @@ void epicsShareAPI logClientFlush ( logClientId id ) break; } } + pClient->nextMsgIndex -= nSent; + if ( nSent > 0 && pClient->nextMsgIndex > 0 ) { + memmove ( pClient->msgBuf, & pClient->msgBuf[nSent], + pClient->nextMsgIndex ); + } epicsMutexUnlock ( pClient->mutex ); } From 9df98c18386f1204fdf21a58f0f6dc1aae04126e Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 28 Aug 2019 15:23:00 +0200 Subject: [PATCH 12/21] send pending log messages directly after connecting --- modules/libcom/src/log/logClient.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 203f29dd3..743910fb8 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -223,7 +223,7 @@ void epicsShareAPI logClientFlush ( logClientId id ) logClient * pClient = ( logClient * ) id; - if ( ! pClient ) { + if ( ! pClient || ! pClient->connected ) { return; } @@ -419,12 +419,8 @@ static void logClientRestart ( logClientId id ) epicsMutexUnlock ( pClient->mutex ); - if ( isConn ) { - logClientFlush ( pClient ); - } - else { - logClientConnect ( pClient ); - } + if ( ! isConn ) logClientConnect ( pClient ); + logClientFlush ( pClient ); epicsEventWaitWithTimeout ( pClient->shutdownNotify, LOG_RESTART_DELAY); From 2b0161d9bfd8fc604942996d1812d245bf4a00f7 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 28 Aug 2019 15:29:23 +0200 Subject: [PATCH 13/21] no need to delay startup only because log server is currently not available --- modules/libcom/src/log/logClient.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 743910fb8..72a2e1364 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -54,7 +54,6 @@ typedef struct { } logClient; static const double LOG_RESTART_DELAY = 5.0; /* sec */ -static const double LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT = 5.0; /* sec */ static const double LOG_SERVER_SHUTDOWN_TIMEOUT = 30.0; /* sec */ /* @@ -438,9 +437,7 @@ static void logClientRestart ( logClientId id ) logClientId epicsShareAPI logClientCreate ( struct in_addr server_addr, unsigned short server_port) { - epicsTimeStamp begin, current; logClient *pClient; - double diff; pClient = calloc (1, sizeof (*pClient)); if (pClient==NULL) { @@ -494,28 +491,6 @@ logClientId epicsShareAPI logClientCreate ( return NULL; } - /* - * attempt to synchronize with circuit connect - */ - epicsTimeGetCurrent ( & begin ); - epicsMutexMustLock ( pClient->mutex ); - do { - epicsMutexUnlock ( pClient->mutex ); - epicsEventWaitWithTimeout ( - pClient->stateChangeNotify, - LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT / 10.0 ); - epicsTimeGetCurrent ( & current ); - diff = epicsTimeDiffInSeconds ( & current, & begin ); - epicsMutexMustLock ( pClient->mutex ); - } - while ( ! pClient->connected && diff < LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT ); - epicsMutexUnlock ( pClient->mutex ); - - if ( ! pClient->connected ) { - fprintf (stderr, "log client create: timed out synchronizing with circuit connect to \"%s\" after %.1f seconds\n", - pClient->name, LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT ); - } - return (void *) pClient; } From 2cafe6d65c9899c1b4dccd2292ac42d22f229de6 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 29 Aug 2019 17:07:20 +0200 Subject: [PATCH 14/21] detect when server closes connection. can only be done reliably with recv, not with send --- modules/libcom/src/log/logClient.c | 31 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 72a2e1364..0056a21fe 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -228,6 +228,23 @@ void epicsShareAPI logClientFlush ( logClientId id ) epicsMutexMustLock ( pClient->mutex ); + while (1) { + struct timeval timeout = { 0, 0 }; + fd_set set; + char buffer[256]; + + FD_ZERO ( &set ); + FD_SET ( pClient->sock, &set ); + if ( select ( pClient->sock + 1, &set, NULL, NULL, &timeout ) == 0) + break; + if ( recv ( pClient->sock, buffer, sizeof ( buffer ), 0 ) == 0 ) { + fprintf ( stderr, "log client: connection closed by server \"%s\"\n", + pClient->name ); + logClientClose ( pClient ); + break; + } + } + while ( nSent < pClient->nextMsgIndex && pClient->connected ) { int status = send ( pClient->sock, pClient->msgBuf + nSent, pClient->nextMsgIndex - nSent, 0 ); @@ -359,20 +376,6 @@ static void logClientConnect (logClient *pClient) fprintf (stderr, "log client: unable to enable keepalive option because \"%s\"\n", sockErrBuf); } - /* - * we don't need full-duplex (clients only write), so we shutdown - * the read end of our socket - */ - status = shutdown (pClient->sock, SHUT_RD); - if (status < 0) { - char sockErrBuf[64]; - epicsSocketConvertErrnoToString ( - sockErrBuf, sizeof ( sockErrBuf ) ); - fprintf (stderr, "%s:%d shutdown(%d,SHUT_RD) error was \"%s\"\n", - __FILE__, __LINE__, pClient->sock, sockErrBuf); - /* not fatal (although it shouldn't happen) */ - } - /* * set how long we will wait for the TCP state machine * to clean up when we issue a close(). This From b925d3f90278e06312f53f6ef190777021dd64e3 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 4 Sep 2019 10:14:05 +0200 Subject: [PATCH 15/21] (Re-)connect only when there is something to send. This avoids constant useless disconnect/connect cycles if the server (or firewall) keeps closing the connection. --- modules/libcom/src/log/logClient.c | 55 ++++++++++++++++++------------ 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 0056a21fe..692ac3105 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -25,7 +25,6 @@ #include "dbDefs.h" #include "epicsEvent.h" #include "iocLog.h" -#include "errlog.h" #include "epicsMutex.h" #include "epicsThread.h" #include "epicsTime.h" @@ -162,6 +161,31 @@ static void logClientDestroy (logClientId id) free ( pClient ); } +/* + * logClientCheckConnection + */ +static void logClientCheckConnection( logClient * pClient ) +{ + epicsMutexMustLock ( pClient->mutex ); + while ( pClient->connected ) { + struct timeval timeout = { 0, 0 }; + fd_set set; + char buffer[256]; + + FD_ZERO ( &set ); + FD_SET ( pClient->sock, &set ); + if ( select ( pClient->sock + 1, &set, NULL, NULL, &timeout ) == 0) + break; + if ( recv ( pClient->sock, buffer, sizeof ( buffer ), 0 ) == 0 ) { + fprintf ( stderr, "log client: connection closed by server \"%s\"\n", + pClient->name ); + logClientClose ( pClient ); + break; + } + } + epicsMutexUnlock ( pClient->mutex ); +} + /* * This method requires the pClient->mutex be owned already. */ @@ -176,6 +200,7 @@ static void sendMessageChunk(logClient * pClient, const char * message) { if ( msgBufBytesLeft < strSize && pClient->nextMsgIndex != 0u && pClient->connected) { /* buffer is full, thus flush it */ + logClientCheckConnection( pClient ); logClientFlush ( pClient ); msgBufBytesLeft = sizeof ( pClient->msgBuf ) - pClient->nextMsgIndex; } @@ -228,23 +253,6 @@ void epicsShareAPI logClientFlush ( logClientId id ) epicsMutexMustLock ( pClient->mutex ); - while (1) { - struct timeval timeout = { 0, 0 }; - fd_set set; - char buffer[256]; - - FD_ZERO ( &set ); - FD_SET ( pClient->sock, &set ); - if ( select ( pClient->sock + 1, &set, NULL, NULL, &timeout ) == 0) - break; - if ( recv ( pClient->sock, buffer, sizeof ( buffer ), 0 ) == 0 ) { - fprintf ( stderr, "log client: connection closed by server \"%s\"\n", - pClient->name ); - logClientClose ( pClient ); - break; - } - } - while ( nSent < pClient->nextMsgIndex && pClient->connected ) { int status = send ( pClient->sock, pClient->msgBuf + nSent, pClient->nextMsgIndex - nSent, 0 ); @@ -415,14 +423,19 @@ static void logClientRestart ( logClientId id ) /* SMP safe state inspection */ epicsMutexMustLock ( pClient->mutex ); while ( ! pClient->shutdown ) { - unsigned isConn; + unsigned isConn, dataToSend; + + logClientCheckConnection( pClient ); isConn = pClient->connected; + dataToSend = pClient->nextMsgIndex; epicsMutexUnlock ( pClient->mutex ); - if ( ! isConn ) logClientConnect ( pClient ); - logClientFlush ( pClient ); + if ( dataToSend ) { + if ( ! isConn ) logClientConnect ( pClient ); + logClientFlush ( pClient ); + } epicsEventWaitWithTimeout ( pClient->shutdownNotify, LOG_RESTART_DELAY); From 9dfed167dce71f17d4562bc40dc7aec6a90e71a2 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 17 Sep 2019 14:39:03 +0200 Subject: [PATCH 16/21] improve logClientShow to show unsent bytes on level 2 (and fix level 1) --- modules/libcom/src/log/logClient.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 692ac3105..f1e9e0806 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -524,14 +524,21 @@ void epicsShareAPI logClientShow (logClientId id, unsigned level) printf ("log client: disconnected from log server at \"%s\"\n", pClient->name); } - if (level>1) { - printf ("log client: sock=%s, connect cycles = %u\n", + if (logClientPrefix) { + printf ("log client: prefix is \"%s\"\n", logClientPrefix); + } + + if (level>0) { + printf ("log client: sock %s, connect cycles = %u\n", pClient->sock==INVALID_SOCKET?"INVALID":"OK", pClient->connectCount); } - - if (logClientPrefix) { - printf ("log client: prefix is \"%s\"\n", logClientPrefix); + if (level>1) { + printf ("log client: %u bytes in buffer\n", pClient->nextMsgIndex); + if (pClient->nextMsgIndex) + printf("-------------------------\n" + "%.*s-------------------------\n", + (int)(pClient->nextMsgIndex), pClient->msgBuf); } } From 5801ff233ae671e27b61035f42554ba6ba3f8757 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 17 Sep 2019 17:06:55 +0200 Subject: [PATCH 17/21] use dynamic debug flag for logClient --- modules/database/src/ioc/misc/dbCore.dbd | 3 +++ modules/libcom/src/log/logClient.c | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/database/src/ioc/misc/dbCore.dbd b/modules/database/src/ioc/misc/dbCore.dbd index 51f9c9640..adde24e4f 100644 --- a/modules/database/src/ioc/misc/dbCore.dbd +++ b/modules/database/src/ioc/misc/dbCore.dbd @@ -33,3 +33,6 @@ variable(callbackParallelThreadsDefault,int) # Real-time operation variable(dbThreadRealtimeLock,int) + +# show logClient network activity +variable(logClientDebug,int) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index f1e9e0806..8000ce9a0 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -21,7 +21,6 @@ #include #include -#define epicsExportSharedSymbols #include "dbDefs.h" #include "epicsEvent.h" #include "iocLog.h" @@ -32,9 +31,13 @@ #include "epicsAssert.h" #include "epicsExit.h" #include "epicsSignal.h" +#include "epicsExport.h" #include "logClient.h" +int logClientDebug = 0; +epicsExportAddress (int, logClientDebug); + typedef struct { char msgBuf[0x4000]; struct sockaddr_in addr; @@ -65,10 +68,10 @@ static char* logClientPrefix = NULL; */ static void logClientClose ( logClient *pClient ) { -# ifdef DEBUG + if (logClientDebug) { fprintf (stderr, "log client: lingering for connection close..."); fflush (stderr); -# endif + } /* * mutex on @@ -90,9 +93,8 @@ static void logClientClose ( logClient *pClient ) */ epicsMutexUnlock (pClient->mutex); -# ifdef DEBUG + if (logClientDebug) fprintf (stderr, "done\n"); -# endif } /* @@ -288,10 +290,10 @@ void epicsShareAPI logClientFlush ( logClientId id ) */ static void logClientMakeSock (logClient *pClient) { - -# ifdef DEBUG + if (logClientDebug) { fprintf (stderr, "log client: creating socket..."); -# endif + fflush (stderr); + } epicsMutexMustLock (pClient->mutex); @@ -309,10 +311,8 @@ static void logClientMakeSock (logClient *pClient) epicsMutexUnlock (pClient->mutex); -# ifdef DEBUG + if (logClientDebug) fprintf (stderr, "done\n"); -# endif - } /* From bad62951081fb98b7729e4ec375dffcc221cadc5 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 18 Sep 2019 16:08:15 +0200 Subject: [PATCH 18/21] don't shutdown write channel of iocLogServer to allow logClient to detect disconnect --- modules/libcom/src/log/iocLogServer.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/libcom/src/log/iocLogServer.c b/modules/libcom/src/log/iocLogServer.c index e707185ae..4d2f14f0e 100644 --- a/modules/libcom/src/log/iocLogServer.c +++ b/modules/libcom/src/log/iocLogServer.c @@ -486,18 +486,6 @@ static void acceptNewClient ( void *pParam ) } } - status = shutdown(pclient->insock, SHUT_WR); - if(status<0){ - char sockErrBuf[64]; - epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - fprintf (stderr, "%s:%d shutdown err %s\n", __FILE__, __LINE__, - sockErrBuf); - epicsSocketDestroy ( pclient->insock ); - free(pclient); - - return; - } - status = fdmgr_add_callback( pserver->pfdctx, pclient->insock, From abbd54b2c8a2989a29b8408198e10dbf6fed2571 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 19 Sep 2019 08:54:19 +0200 Subject: [PATCH 19/21] fix wrong function name in comment --- modules/libcom/src/log/iocLog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/log/iocLog.c b/modules/libcom/src/log/iocLog.c index 8cb1349a1..c0fa33fa6 100644 --- a/modules/libcom/src/log/iocLog.c +++ b/modules/libcom/src/log/iocLog.c @@ -77,7 +77,7 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void) } /* - * logClientDestroy() + * iocLogClientDestroy() */ static void iocLogClientDestroy (logClientId id) { From 301a6e00b9bcc9933ea15290a89b995bede11b2d Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 19 Sep 2019 10:44:36 +0200 Subject: [PATCH 20/21] moved logClientSendMessage and made it static --- modules/libcom/src/log/iocLog.c | 11 +++++++++++ modules/libcom/src/log/logClient.c | 10 ---------- modules/libcom/src/log/logClient.h | 1 - 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/libcom/src/log/iocLog.c b/modules/libcom/src/log/iocLog.c index c0fa33fa6..ba78041c8 100644 --- a/modules/libcom/src/log/iocLog.c +++ b/modules/libcom/src/log/iocLog.c @@ -76,6 +76,16 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void) } } +/* + * logClientSendMessage () + */ +static void logClientSendMessage ( logClientId id, const char * message ) +{ + if ( !iocLogDisable ) { + logClientSend (id, message); + } +} + /* * iocLogClientDestroy() */ @@ -149,3 +159,4 @@ logClientId epicsShareAPI logClientInit (void) { return iocLogClientInit (); } + diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 8000ce9a0..73377870d 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -542,16 +542,6 @@ void epicsShareAPI logClientShow (logClientId id, unsigned level) } } -/* - * logClientSendMessage (); deprecated - */ -void logClientSendMessage ( logClientId id, const char * message ) -{ - if ( !iocLogDisable ) { - logClientSend (id, message); - } -} - /* * iocLogPrefix() */ diff --git a/modules/libcom/src/log/logClient.h b/modules/libcom/src/log/logClient.h index 1797bbb20..3b3f63add 100644 --- a/modules/libcom/src/log/logClient.h +++ b/modules/libcom/src/log/logClient.h @@ -38,7 +38,6 @@ epicsShareFunc void epicsShareAPI iocLogPrefix(const char* prefix); /* deprecated interface; retained for backward compatibility */ /* note: implementations are in iocLog.c, not logClient.c */ epicsShareFunc logClientId epicsShareAPI logClientInit (void); -epicsShareFunc void logClientSendMessage (logClientId id, const char *message); #ifdef __cplusplus } From 5f0df840a38400ade08985ab9b81f8f65bdcf5a3 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 19 Sep 2019 17:53:04 +0200 Subject: [PATCH 21/21] increase error message buffer size for long (Windows) error messges --- modules/libcom/src/log/logClient.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/libcom/src/log/logClient.c b/modules/libcom/src/log/logClient.c index 73377870d..986c7b807 100644 --- a/modules/libcom/src/log/logClient.c +++ b/modules/libcom/src/log/logClient.c @@ -263,7 +263,7 @@ void epicsShareAPI logClientFlush ( logClientId id ) } else { if ( ! pClient->shutdown ) { - char sockErrBuf[64]; + char sockErrBuf[128]; if ( status ) { epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); } @@ -302,7 +302,7 @@ static void logClientMakeSock (logClient *pClient) */ pClient->sock = epicsSocketCreate ( AF_INET, SOCK_STREAM, 0 ); if ( pClient->sock == INVALID_SOCKET ) { - char sockErrBuf[64]; + char sockErrBuf[128]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); fprintf ( stderr, "log client: no socket error %s\n", @@ -352,7 +352,7 @@ static void logClientConnect (logClient *pClient) } else { if ( pClient->connFailStatus != errnoCpy && ! pClient->shutdown ) { - char sockErrBuf[64]; + char sockErrBuf[128]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); fprintf (stderr, @@ -378,7 +378,7 @@ static void logClientConnect (logClient *pClient) optval = TRUE; status = setsockopt (pClient->sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&optval, sizeof(optval)); if (status<0) { - char sockErrBuf[64]; + char sockErrBuf[128]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); fprintf (stderr, "log client: unable to enable keepalive option because \"%s\"\n", sockErrBuf); @@ -397,7 +397,7 @@ static void logClientConnect (logClient *pClient) lingerval.l_linger = 60*5; status = setsockopt (pClient->sock, SOL_SOCKET, SO_LINGER, (char *) &lingerval, sizeof(lingerval)); if (status<0) { - char sockErrBuf[64]; + char sockErrBuf[128]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); fprintf (stderr, "log client: unable to set linger options because \"%s\"\n", sockErrBuf);