new functions that fetch on behalf host name and user name

This commit is contained in:
Jeff Hill
2004-03-24 18:56:55 +00:00
parent ea35450f45
commit 58d4f27307

View File

@@ -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';
}
}