From: Viktor M. <mih...@us...> - 2005-07-19 14:44:00
|
Update of /cvsroot/sblim/sfcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21069 Modified Files: client.c cmci.h test.c Removed Files: cimXmlResp.h Log Message: added scheme parameter to cmciConnect. Index: cmci.h =================================================================== RCS file: /cvsroot/sblim/sfcc/cmci.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cmci.h 26 Jun 2005 21:46:02 -0000 1.7 +++ cmci.h 19 Jul 2005 14:43:32 -0000 1.8 @@ -449,7 +449,7 @@ CMCIClientFT *ft; }; -CMCIClient *cmciConnect(const char *hn, const char *port, +CMCIClient *cmciConnect(const char *hn, const char* scheme, const char *port, const char *user, const char *pwd, CMPIStatus *rc); #ifdef __cplusplus Index: client.c =================================================================== RCS file: /cvsroot/sblim/sfcc/client.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- client.c 26 Jun 2005 21:46:02 -0000 1.16 +++ client.c 19 Jul 2005 14:43:32 -0000 1.17 @@ -1848,7 +1848,7 @@ /* --------------------------------------------------------------------------*/ -CMCIClient *cmciConnect(const char *hn, const char *port, +CMCIClient *cmciConnect(const char *hn, const char *scheme, const char *port, const char *user, const char *pwd, CMPIStatus *rc) { ClientEnc *cc=(ClientEnc*)calloc(1,sizeof(ClientEnc)); @@ -1857,11 +1857,16 @@ cc->enc.ft=&clientFt; cc->data.hostName= hn ? strdup(hn) : "localhost"; - cc->data.port= port ? strdup(port) : "5988"; cc->data.user= user ? strdup(user) : NULL; cc->data.pwd= pwd ? strdup(pwd) : NULL; - cc->data.scheme= "http"; - + cc->data.scheme= scheme ? strdup(scheme) : "http"; + if (port == NULL) { + if (strcmp(cc->data.scheme,"http")==0) { + cc->data.port="5988"; + } else if (strcmp(cc->data.scheme,"https")==0) { + cc->data.port="5989"; + } + } cc->connection=initConnection(&cc->data); return (CMCIClient*)cc; Index: test.c =================================================================== RCS file: /cvsroot/sblim/sfcc/test.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test.c 26 Jun 2005 21:46:02 -0000 1.13 +++ test.c 19 Jul 2005 14:43:32 -0000 1.14 @@ -89,7 +89,7 @@ char hostName[512]; /* Setup a conncetion to the CIMOM */ - cc = cmciConnect("localhost",NULL,NULL,NULL,NULL); + cc = cmciConnect("localhost","http",NULL,NULL,NULL,NULL); gethostname(hostName,511); _HOSTNAME=strdup(hostName); --- cimXmlResp.h DELETED --- |