From: Chris B. <buc...@us...> - 2011-03-29 20:34:58
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCC - Small Footprint CIM Client". The branch, master has been updated via 705df8e8c466bd097920c5c2b8f77d26fab748e7 (commit) from ddae6fe79ba7283a27b46bafb3da1c5fdf0fc6c1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 705df8e8c466bd097920c5c2b8f77d26fab748e7 Author: buccella <buc...@li...> Date: Tue Mar 29 16:34:43 2011 -0400 [ 1956407 ] CIM-XML/HTTP connection to unix socket ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 7027f98..26da31a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-03-29 Chris Buccella <buc...@li...> + * backend/cimxml/client.c: + [ 1956407 ] CIM-XML/HTTP connection to unix socket + (patch by Bart Whiteley) + * backend/cimxml/grammar.c: [ 3196128 ] enumInstances does not set NameSpace in ObjectPath in XML mode (patch by Josef Moellers) diff --git a/NEWS b/NEWS index d007ee6..184cfd1 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Bugs: - 3195267: sfcc v2 tests segfault when sfcb is not running - 2990315: cmciRelease not called in case of error - 3196128: enumInstances does not set NameSpace in ObjectPath in XML mode +- 1956407: CIM-XML/HTTP connection to unix socket Changes in 2.2.1 ================ diff --git a/backend/cimxml/client.c b/backend/cimxml/client.c index ced221f..fb56094 100644 --- a/backend/cimxml/client.c +++ b/backend/cimxml/client.c @@ -27,6 +27,7 @@ #include <time.h> // new #include <sys/time.h> // new +#include <sys/un.h> // new #include "config.h" @@ -269,6 +270,27 @@ static size_t writeHeaders(void *ptr, size_t size, } +#if LIBCURL_VERSION_NUM >= 0x071101 +static curl_socket_t opensockCb(void *clientp, + curlsocktype purpose, + struct curl_sockaddr *caddr) +{ + const char* path = (const char*)clientp; + struct sockaddr_un* unaddr = (struct sockaddr_un*)&caddr->addr; + caddr->family = AF_UNIX; + caddr->addrlen = sizeof(struct sockaddr_un); + /* This is actually safe. caddr is padded. See singleipconnect() + * in lib/connect.c within libcurl for details */ + memset(unaddr, 0, caddr->addrlen); + unaddr->sun_family = AF_UNIX; + strncpy(unaddr->sun_path, path, sizeof(unaddr->sun_path)); + caddr->protocol = 0; + return socket(caddr->family, caddr->socktype, caddr->protocol); +} +#endif + +/* --------------------------------------------------------------------------*/ + static size_t writeCb(void *ptr, size_t size, size_t nmemb, void *stream) { @@ -376,8 +398,19 @@ static char* genRequest(ClientEnc *cle, const char *op, con->mResponse->ft->reset(con->mResponse); con->mUri->ft->reset(con->mUri); - con->mUri->ft->append6Chars(con->mUri, cld->scheme, "://", cld->hostName, - ":", cld->port, "/cimom"); + +#if LIBCURL_VERSION_NUM >= 0x071101 + if (cld->port != NULL && cld->port[0] == '/') { + // Setup connection to Unix Socket + con->mUri->ft->append3Chars(con->mUri, cld->scheme, "://", cld->hostName); + con->mUri->ft->appendChars(con->mUri, "/cimom"); + curl_easy_setopt(con->mHandle, CURLOPT_OPENSOCKETDATA, cld->port); + curl_easy_setopt(con->mHandle, CURLOPT_OPENSOCKETFUNCTION, opensockCb); + } + else +#endif + con->mUri->ft->append6Chars(con->mUri, cld->scheme, "://", + cld->hostName, ":", cld->port, "/cimom"); /* Initialize curl with the url */ curl_easy_setopt(con->mHandle, CURLOPT_URL, diff --git a/contributions.txt b/contributions.txt index de54043..df15190 100644 --- a/contributions.txt +++ b/contributions.txt @@ -46,3 +46,7 @@ Suresh Sundriyal, VMWare Josef Moellers, Fujitsu ----------------------- 03/29/2011 [ 3196128 ] enumInstances does not set NameSpace in ObjectPath in XML mode + +J. Bart Whiteley, Novell +------------------------ +03/29/2011 [ 1956407 ] CIM-XML/HTTP connection to unix socket hooks/post-receive -- SFCC - Small Footprint CIM Client |