From 58d4f27307cf64298871cd08a58f1388b1c321ca Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 24 Mar 2004 18:56:55 +0000 Subject: [PATCH] new functions that fetch on behalf host name and user name --- src/rsrv/camsgtask.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/rsrv/camsgtask.c b/src/rsrv/camsgtask.c index 78127a74b..d8edd2594 100644 --- a/src/rsrv/camsgtask.c +++ b/src/rsrv/camsgtask.c @@ -160,3 +160,37 @@ void camsgtask ( void *pParm ) destroy_tcp_client ( client ); } + + +void rsrvHostNameOnBehalf ( char * pBuf, unsigned bufSize ) +{ + if ( bufSize ) { + const char * pHostName = ""; + { + struct client * pClient = ( struct client * ) + epicsThreadPrivateGet ( rsrvCurrentClient ); + if ( pClient ) { + pHostName = pClient->pHostName; + } + } + strncpy ( pBuf, pHostName, bufSize ); + pBuf [ bufSize - 1u ] = '\0'; + } +} + +void rsrvUserNameOnBehalf ( char * pBuf, unsigned bufSize ) +{ + if ( bufSize ) { + const char * pUserName = ""; + { + struct client * pClient = ( struct client * ) + epicsThreadPrivateGet ( rsrvCurrentClient ); + if ( pClient ) { + pUserName = pClient->pUserName; + } + } + strncpy ( pBuf, pUserName, bufSize ); + pBuf [ bufSize - 1u ] = '\0'; + } +} +