From 36f9090897386b87fa1881087adf0aa6b00acecc Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 24 Mar 2004 19:02:56 +0000 Subject: [PATCH] new functions that fetch on behalf host name and user name --- src/rsrv/camsgtask.c | 4 ++-- src/rsrv/caservertask.c | 5 +++++ src/rsrv/rsrv.h | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/rsrv/camsgtask.c b/src/rsrv/camsgtask.c index d8edd2594..ebe98a0b4 100644 --- a/src/rsrv/camsgtask.c +++ b/src/rsrv/camsgtask.c @@ -162,7 +162,7 @@ void camsgtask ( void *pParm ) } -void rsrvHostNameOnBehalf ( char * pBuf, unsigned bufSize ) +void epicsShareAPI casHostNameInitiatingCurrentThread ( char * pBuf, unsigned bufSize ) { if ( bufSize ) { const char * pHostName = ""; @@ -178,7 +178,7 @@ void rsrvHostNameOnBehalf ( char * pBuf, unsigned bufSize ) } } -void rsrvUserNameOnBehalf ( char * pBuf, unsigned bufSize ) +void epicsShareAPI casUserNameInitiatingCurrentThread ( char * pBuf, unsigned bufSize ) { if ( bufSize ) { const char * pUserName = ""; diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 04eb414e3..3766aa081 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -46,6 +46,8 @@ #define DELETE_TASK(NAME)\ if(threadNameToId(NAME)!=0)threadDestroy(threadNameToId(NAME)); +epicsThreadPrivateId rsrvCurrentClient; + /* * * req_server() @@ -71,6 +73,8 @@ LOCAL void req_server (void *pParm) epicsSignalInstallSigPipeIgnore (); taskwdInsert ( epicsThreadGetIdSelf (), NULL, NULL ); + + rsrvCurrentClient = epicsThreadPrivateCreate (); if ( envGetConfigParamPtr ( &EPICS_CAS_SERVER_PORT ) ) { ca_server_port = envGetInetPortConfigParam ( &EPICS_CAS_SERVER_PORT, @@ -708,6 +712,7 @@ void casAttachThreadToClient ( struct client *pClient ) epicsSignalInstallSigAlarmIgnore (); epicsSignalInstallSigPipeIgnore (); pClient->tid = epicsThreadGetIdSelf (); + epicsThreadPrivateSet ( rsrvCurrentClient, pClient ); taskwdInsert ( pClient->tid, NULL, NULL ); } diff --git a/src/rsrv/rsrv.h b/src/rsrv/rsrv.h index 26418af3a..6d41abab9 100644 --- a/src/rsrv/rsrv.h +++ b/src/rsrv/rsrv.h @@ -24,7 +24,8 @@ epicsShareFunc int epicsShareAPI rsrv_init (void); epicsShareFunc void epicsShareAPI casr (unsigned level); - +epicsShareFunc void epicsShareAPI casHostNameInitiatingCurrentThread ( char * pBuf, unsigned bufSize ); +epicsShareFunc void epicsShareAPI casUserNameInitiatingCurrentThread ( char * pBuf, unsigned bufSize ); #define RSRV_OK 0 #define RSRV_ERROR (-1)