diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index ba83af1b3..e0521cf3a 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -274,21 +274,18 @@ static void log_header ( pciu = MPTOPCIU(mp); if (pContext) { - epicsPrintf ("CAS: request from %s => \"%s\"\n", + epicsPrintf ("CAS: request from %s => %s\n", hostName, pContext); } - epicsPrintf ( -"CAS: Request from %s => cmmd=%d cid=0x%x type=%d count=%d postsize=%u\n", + epicsPrintf ( "CAS: Request from %s => cmmd=%d cid=0x%x type=%d count=%d postsize=%u\n", hostName, mp->m_cmmd, mp->m_cid, mp->m_dataType, mp->m_count, mp->m_postsize); - epicsPrintf ( -"CAS: Request from %s => available=0x%x \tN=%u paddr=%p\n", - hostName, mp->m_available, mnum, (pciu?(void *)&pciu->addr:NULL)); + epicsPrintf ( "CAS: Request from %s => available=0x%x \tN=%u paddr=%p\n", + hostName, mp->m_available, mnum, (pciu ? (void *)&pciu->addr : NULL)); if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_dataType==DBF_STRING && pPayLoad ) { - epicsPrintf ( -"CAS: Request from %s => \tThe string written: %s \n", + epicsPrintf ( "CAS: Request from %s => Wrote string \"%s\"\n", hostName, (char *)pPayLoad ); } } diff --git a/src/rsrv/camsgtask.c b/src/rsrv/camsgtask.c index a5133caf6..c1f112961 100644 --- a/src/rsrv/camsgtask.c +++ b/src/rsrv/camsgtask.c @@ -67,9 +67,10 @@ void camsgtask ( void *pParm ) status = socket_ioctl (client->sock, FIONREAD, &nchars); if (status < 0) { char sockErrBuf[64]; + epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - errlogPrintf("CAS: io ctl err - %s\n", + errlogPrintf("CAS: ioctl error - %s\n", sockErrBuf); cas_send_bs_msg(client, TRUE); } @@ -98,9 +99,8 @@ void camsgtask ( void *pParm ) } if ( anerrno == SOCK_ENOBUFS ) { - errlogPrintf ( - "rsrv: system low on network buffers " - "- receive retry in 15 seconds\n" ); + errlogPrintf ( + "CAS: Out of network buffers, retring receive in 15 seconds\n" ); epicsThreadSleep ( 15.0 ); continue; } @@ -109,10 +109,15 @@ void camsgtask ( void *pParm ) * normal conn lost conditions */ if ( ( anerrno != SOCK_ECONNABORTED && - anerrno != SOCK_ECONNRESET && - anerrno != SOCK_ETIMEDOUT ) || - CASDEBUG > 2 ) { - errlogPrintf ( "CAS: client disconnect(errno=%d)\n", anerrno ); + anerrno != SOCK_ECONNRESET && + anerrno != SOCK_ETIMEDOUT ) || + CASDEBUG > 2 ) { + char sockErrBuf[64]; + + epicsSocketConvertErrorToString( + sockErrBuf, sizeof ( sockErrBuf ), anerrno); + errlogPrintf ( "CAS: Client disconnected - %s\n", + sockErrBuf ); } break; } diff --git a/src/rsrv/caserverio.c b/src/rsrv/caserverio.c index 466e492f0..387bf210b 100644 --- a/src/rsrv/caserverio.c +++ b/src/rsrv/caserverio.c @@ -90,7 +90,8 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed ) } if ( anerrno == SOCK_ENOBUFS ) { - errlogPrintf ( "rsrv: system low on network buffers - send retry in 15 seconds\n" ); + errlogPrintf ( + "CAS: Out of network buffers, retrying send in 15 seconds\n" ); epicsThreadSleep ( 15.0 ); continue; } @@ -108,8 +109,7 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed ) char sockErrBuf[64]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - errlogPrintf ( - "CAS: TCP send to \"%s\" failed because \"%s\"\n", + errlogPrintf ( "CAS: TCP send to %s failed - %s\n", buf, sockErrBuf); } pclient->disconnect = TRUE; @@ -135,7 +135,7 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed ) char sockErrBuf[64]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - errlogPrintf ("rsrv: socket shutdown error was %s\n", + errlogPrintf ("CAS: Socket shutdown error - %s\n", sockErrBuf ); } } @@ -204,7 +204,7 @@ void cas_send_dg_msg ( struct client * pclient ) } else { errlogPrintf ( - "cas: system failed to send entire udp frame?\n" ); + "CAS: System failed to send entire udp frame?\n" ); } } else { @@ -213,11 +213,8 @@ void cas_send_dg_msg ( struct client * pclient ) epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); ipAddrToDottedIP ( &pclient->addr, buf, sizeof(buf) ); - errlogPrintf( - "CAS: UDP send to \"%s\" " - "failed because \"%s\"\n", - buf, - sockErrBuf); + errlogPrintf( "CAS: UDP send to %s failed - %s\n", + buf, sockErrBuf); } pclient->send.stk = 0u; diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 21bcba9f4..7c911d64b 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -252,7 +252,7 @@ int rsrv_init (void) status = envGetLongConfigParam ( &EPICS_CA_MAX_ARRAY_BYTES, &maxBytesAsALong ); if ( status || maxBytesAsALong < 0 ) { - errlogPrintf ( "cas: EPICS_CA_MAX_ARRAY_BYTES was not a positive integer\n" ); + errlogPrintf ( "CAS: EPICS_CA_MAX_ARRAY_BYTES was not a positive integer\n" ); rsrvSizeofLargeBufTCP = MAX_TCP; } else { @@ -266,7 +266,7 @@ int rsrv_init (void) maxBytes = 0xffffffff; } if ( maxBytes < MAX_TCP ) { - errlogPrintf ( "cas: EPICS_CA_MAX_ARRAY_BYTES was rounded up to %u\n", MAX_TCP ); + errlogPrintf ( "CAS: EPICS_CA_MAX_ARRAY_BYTES was rounded up to %u\n", MAX_TCP ); rsrvSizeofLargeBufTCP = MAX_TCP; } else { @@ -551,7 +551,7 @@ void destroy_client ( struct client *client ) freeListFree ( rsrvLargeBufFreeListTCP, client->send.buf ); } else { - errlogPrintf ( "cas: Corrupt send buffer free list type code=%u during client cleanup?\n", + errlogPrintf ( "CAS: Corrupt send buffer free list type code=%u during client cleanup?\n", client->send.type ); } } @@ -563,7 +563,7 @@ void destroy_client ( struct client *client ) freeListFree ( rsrvLargeBufFreeListTCP, client->recv.buf ); } else { - errlogPrintf ( "cas: Corrupt recv buffer free list type code=%u during client cleanup?\n", + errlogPrintf ( "CAS: Corrupt recv buffer free list type code=%u during client cleanup?\n", client->send.type ); } }