Skip to content

Commit

Permalink
Merge branch 'OpenMAMA-2.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
fquinner committed Jul 17, 2015
2 parents 10e1dd1 + 4d3d282 commit f9ff394
Show file tree
Hide file tree
Showing 76 changed files with 1,621 additions and 93 deletions.
3 changes: 2 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
OpenMAMA Client Library
============================

Change Log: http://git.openmama.org/?p=OpenMAMA.git;a=shortlog;h=refs/tags/OpenMAMA-2.3.2-release
Release: 2.3.3
Change Log: http://git.openmama.org/?p=OpenMAMA.git;a=shortlog;h=refs/heads/OpenMAMA-2.3.3-release

Project Page
------------
Expand Down
5 changes: 2 additions & 3 deletions common/c_cpp/src/c/linux/wInterlocked.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,11 @@ WCOMMONINLINE int wInterlocked_read(wInterlockedInt *value)
*
* @param[in] newValue The new value to set.
* @param[in] value Pointer to the value to be set.
* @return The updated integer.
* @return The original integer in value.
*/
WCOMMONINLINE int wInterlocked_set(int newValue, wInterlockedInt *value)
{
axchg32(value, (uint32_t)newValue);
return (int)*value;
return axchg32(value, (uint32_t)newValue);
}

#endif /* _WOMBAT_WINTERLOCKED_H */
12 changes: 12 additions & 0 deletions common/c_cpp/src/c/properties.l
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ WS [ \t]
/* value string */
if ( curKey && curValue )
{
replaceValue =
propertiesImpl_ReplaceEnvironmentVariable(curValue);
if(replaceValue != NULL)
{
/* Delete the original value */
free(curValue);

/* Copy the replace value into the
* current value pointer. */
curValue = replaceValue;
}

propertiesImpl_AddProperty( properties,
curKey, curValue );
if( gPropertyDebug )
Expand Down
19 changes: 16 additions & 3 deletions common/c_cpp/src/c/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,27 @@ wombatQueue_destroy (wombatQueue queue)
result = WOMBAT_QUEUE_SEM_ERR;
}

wInterlocked_destroy (&impl->mUnblocking);

wthread_mutex_destroy( &impl->mLock);

if (WOMBAT_QUEUE_OK == result)
{
return wombatQueue_deallocate(queue);
}
else
{
return result;
}
}

wombatQueueStatus
wombatQueue_deallocate (wombatQueue queue)
{
wombatQueueImpl *impl = (wombatQueueImpl*)queue;
wInterlocked_destroy (&impl->mUnblocking);
free (impl);
return WOMBAT_QUEUE_OK;
}


wombatQueueStatus
wombatQueue_setMaxSize (wombatQueue queue, unsigned int value)
{
Expand Down
2 changes: 1 addition & 1 deletion common/c_cpp/src/c/windows/wombat/wInterlocked.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ WCOMMONINLINE int wInterlocked_read(wInterlockedInt *value)
*
* @param[in] newValue The new value to set.
* @param[in] value Pointer to the value to be set.
* @return The updated integer.
* @return The original integer in value.
*/
WCOMMONINLINE int wInterlocked_set(int newValue, wInterlockedInt *value)
{
Expand Down
15 changes: 14 additions & 1 deletion common/c_cpp/src/c/wombat/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,24 @@ wombatQueue_create (wombatQueue queue, uint32_t maxSize, uint32_t initialSize,
uint32_t growBySize);

/**
* Destroy the Queue.
* Destroy the Queue, and free any memory associated
* with the Queue.
*
* wombatQueue_create() must have been successfully called
* before calling this method.
*/
COMMONExpDLL wombatQueueStatus
wombatQueue_destroy (wombatQueue queue);

/**
* Free any memory associated with the Queue.
*
* Unless wombatQueue_create() failed, prefer calling
* wombatQueue_destroy().
*/
COMMONExpDLL wombatQueueStatus
wombatQueue_deallocate(wombatQueue queue);

/**
* Set the maximum size of the queue. WOMBAT_QUEUE_MAX_SIZE is the maximum
* queue size permitted and the default value. This value should be a multiple
Expand Down
2 changes: 1 addition & 1 deletion mama/VERSION.scons
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mama 2.3.2
mama 2.3.3
5 changes: 2 additions & 3 deletions mama/c_cpp/SConscript.win
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,13 @@ if env['with_testtools'] == True and 'dynamic' in env['build']:
if ( not Media.has_key('mama/c_cpp/docs')
and env['build'] == 'dynamic'
and not env.GetOption('clean')
and env['product'] == 'mama'
and env['with_docs'] == True ):

cdoc = env.Doxygen('doxyconfig-c.in')
cppdoc = env.Doxygen('doxyconfig-cpp.in')

env.Command( '$prefix/doc/mama/images', cdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\images\* $TARGET' % ( env['TOPLEVEL'] ) )
env.Command( '$prefix/doc/mama/c/html', cdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\c\html\* $TARGET' % ( env['TOPLEVEL'] ) )
env.Command( '$prefix/doc/mama/cpp/html', cppdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\cpp\html\* $TARGET' % ( env['TOPLEVEL'] ) )
env.Command( '$prefix/doc/mama', '', 'mkdir $TARGET && xcopy /q /s /e /y %s\mama\c_cpp\doc\* $TARGET' % ( env['TOPLEVEL'] ) )

env.Clean( cdoc, '%s/mama/c_cpp/doc/c' % (env['TOPLEVEL']) )
env.Clean( cppdoc, '%s/mama/c_cpp/doc/cpp' % (env['TOPLEVEL']) )
Expand Down
4 changes: 2 additions & 2 deletions mama/c_cpp/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#
##################################################
m4_define([product_version_major], [2])
m4_define([product_version_minor], [2])
m4_define([product_version_release], [1.1])
m4_define([product_version_minor], [3])
m4_define([product_version_release], [3])
m4_define([product_full_version],[product_version_major.product_version_minor.product_version_release])


Expand Down
2 changes: 1 addition & 1 deletion mama/c_cpp/doxyconfig-c.in
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = ./src/c/mama ./src/enterprise/c/mama
INPUT = ./src/c/mama

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
2 changes: 1 addition & 1 deletion mama/c_cpp/doxyconfig-cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = ./src/cpp/mama ./src/enterprise/cpp/mama
INPUT = ./src/cpp/mama

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
1 change: 1 addition & 0 deletions mama/c_cpp/src/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ libmama_la_SOURCES = \
mamaStrUtils.h \
mamaStrUtils.c \
marketdata.c \
plugin.c \
middleware.c \
msg.c \
msgfield.c \
Expand Down
1 change: 1 addition & 0 deletions mama/c_cpp/src/c/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ libmama_sources = \
mama.c
mamaStrUtils.c
marketdata.c
plugin.c
middleware.c
msg.c
msgfield.c
Expand Down
3 changes: 1 addition & 2 deletions mama/c_cpp/src/c/SConscript.win
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dqpublishermanager.c
inbox.c
msgtype.c
msgutils.c
plugin.c
senderId.c
reservedfields.c
subscription.c
Expand All @@ -75,9 +76,7 @@ playback/playbackcapture.c
playback/playbackFileParser.c
playback/playbackpublisher.c
fieldcache/fieldcachefield.c
fieldcache/fieldcachemapbinary.c
fieldcache/fieldcachemaparray.c
fieldcache/fieldcachemapmonitor.c
fieldcache/fieldcacheimpl.c
fieldcache/fieldcachemap.c
fieldcache/fieldcacheiterator.c
Expand Down
66 changes: 66 additions & 0 deletions mama/c_cpp/src/c/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
*/

#include <mama/mama.h>
#include <wombat/strutils.h>
#include "bridge.h"

#define MAX_PROP_STRING 1000
#define PROP_NAME_ENTITLEMENTS_DEFERRED "entitlements.deferred"

int mamaBridgeImpl_getDefaultQueueTimeout(void)
{
/* Returns. */
Expand Down Expand Up @@ -143,3 +147,65 @@ mamaBridgeImpl_stopInternalEventQueue (mamaBridge bridgeImpl)

return MAMA_STATUS_OK;
}

mama_status
mamaBridgeImpl_setReadOnlyProperty (mamaBridge bridgeImpl, const char* property, const char* value)
{
mamaBridgeImpl_setProperty(bridgeImpl, property, value);
bridgeImpl->mEntitleReadOnly = 1;
return MAMA_STATUS_OK;
}

mama_status
mamaBridgeImpl_setProperty (mamaBridge bridgeImpl, const char* property, const char* value)
{
char propString[MAX_PROP_STRING];

mamaBridgeImpl* impl = (mamaBridgeImpl*)bridgeImpl;

/* Check for mama.middleware.entitlements_deferred first */
snprintf(propString, MAX_PROP_STRING,
"mama.%s.%s",
impl->bridgeGetName(),
PROP_NAME_ENTITLEMENTS_DEFERRED);

if(0 == strcmp(property, propString))
{
if (1 == bridgeImpl->mEntitleReadOnly)
{
mama_log (MAMA_LOG_LEVEL_WARN, "mamaBridgeImpl_setProperty(): "
"Bridge is read only, property can not be set.");
return MAMA_STATUS_INVALID_ARG;
}
else
{
if (strtobool(value))
bridgeImpl->mEntitleDeferred = 1;
else
bridgeImpl->mEntitleDeferred = 0;
}
}
else
{
mama_log (MAMA_LOG_LEVEL_WARN, "mamaBridgeImpl_setProperty(): "
"Unknown property string [%s] entered.", property);
return MAMA_STATUS_INVALID_ARG;
}
return MAMA_STATUS_OK;
}

const char*
mamaBridgeImpl_getProperty (mamaBridge bridgeImpl, const char* property)
{
return NULL;
}

mama_bool_t
mamaBridgeImpl_areEntitlementsDeferred (mamaBridge bridgeImpl)
{
if (bridgeImpl)
{
return bridgeImpl->mEntitleDeferred;
}
return 0;
}
20 changes: 20 additions & 0 deletions mama/c_cpp/src/c/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@ typedef struct mamaBridgeImpl_
used when getting the default queue */
void* mCppCallback;

/*Used in bridge.c*/
mama_bool_t mEntitleDeferred;
mama_bool_t mEntitleReadOnly;

/*Used in mama.c*/
bridge_open bridgeOpen;
bridge_close bridgeClose;
Expand Down Expand Up @@ -873,6 +877,22 @@ MAMAExpDLL
mama_status
mamaBridgeImpl_stopInternalEventQueue (mamaBridge bridgeImpl);

MAMAExpDLL
extern mama_status
mamaBridgeImpl_setReadOnlyProperty (mamaBridge bridgeImpl, const char* property, const char* value);

MAMAExpDLL
extern mama_status
mamaBridgeImpl_setProperty (mamaBridge bridgeImpl, const char* property, const char* value);

MAMAExpDLL
extern const char*
mamaBridgeImpl_getProperty (mamaBridge bridgeImpl, const char* property);

MAMAExpDLL
extern mama_bool_t
mamaBridgeImpl_areEntitlementsDeferred (mamaBridge bridgeImpl);

#if defined(__cplusplus)
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions mama/c_cpp/src/c/bridge/qpid/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void qpidBridge_createImpl (mamaBridge* result)

/* Return the newly created bridge */
*result = (mamaBridge) bridge;

mamaBridgeImpl_setReadOnlyProperty ((mamaBridge)bridge, "mama.qpid.entitlements.deferred", "false");
}

mama_status
Expand Down
5 changes: 4 additions & 1 deletion mama/c_cpp/src/c/bridge/qpid/qpiddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <list.h>

/* Qpid include files */
#include <proton/driver.h>
#include <proton/message.h>
#include <proton/messenger.h>

Expand Down Expand Up @@ -87,6 +86,10 @@ typedef enum qpidMsgType_
#if (PN_VERSION_MAJOR == 0 && PN_VERSION_MINOR <= 7)
#include <proton/util.h>
#endif
#if (PN_VERSION_MAJOR == 0 && PN_VERSION_MINOR <= 8)
/* The proton header driver.h was removed in version 0.9 */
#include <proton/driver.h>
#endif

/* Place other version specific macros here */

Expand Down
2 changes: 1 addition & 1 deletion mama/c_cpp/src/c/bridge/qpid/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ qpidBridgeMamaQueue_create (queueBridge* queue,
mama_log (MAMA_LOG_LEVEL_ERROR,
"qpidBridgeMamaQueue_create (): "
"Failed to create underlying queue.");
wombatQueue_destroy (impl->mQueue);
wombatQueue_deallocate (impl->mQueue);
free (impl);
return MAMA_STATUS_PLATFORM;
}
Expand Down
2 changes: 1 addition & 1 deletion mama/c_cpp/src/c/bridge/qpid/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ void* qpidBridgeMamaTransportImpl_dispatchThread (void* closure)
case QPID_MSG_SUB_REQUEST:
{
pn_data_t* data = pn_message_body (msgNode->mMsg);
char* topic = NULL;
const char* topic = NULL;
const char* replyTo = NULL;

/* Move to the content which will contain the topic */
Expand Down
5 changes: 5 additions & 0 deletions mama/c_cpp/src/c/conflation/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ mamaConflationManager_create (mamaConflationManager mgr)
return MAMA_STATUS_NOMEM;

if (wombatQueue_create (impl->mMsgQueue, 0, 0, 0) != WOMBAT_QUEUE_OK)
{
wombatQueue_deallocate(impl->mMsgQueue);
impl->mMsgQueue = NULL;

return MAMA_STATUS_CONFLATE_ERROR;
}

status = mamaMsg_create (&impl->mMsg);

Expand Down
Loading

0 comments on commit f9ff394

Please sign in to comment.