zeromq: support no auth and multi frame

This commit is contained in:
Brian Knox 2016-05-13 06:49:31 -04:00
parent 299f5a637f
commit 7f6da6456a
2 changed files with 39 additions and 33 deletions

View File

@ -359,6 +359,7 @@ static rsRetVal rcvData(){
pData = zlist_next(listenerList);
}
zframe_t *frame;
zsock_t *which = (zsock_t *)zpoller_wait(poller, -1);
while (which) {
pData = zlist_first(listenerList);
@ -370,7 +371,9 @@ static rsRetVal rcvData(){
DBGPRINTF("imczmq: found matching socket\n");
}
char *buf = zstr_recv(which);
frame = zframe_recv(which);
char *buf = zframe_strdup(frame);
if (buf == NULL) {
DBGPRINTF("imczmq: null buffer\n");
continue;
@ -389,10 +392,11 @@ static rsRetVal rcvData(){
submitMsg2(pMsg);
}
zstr_free(&buf);
free(buf);
which = (zsock_t *)zpoller_wait(poller, -1);
}
finalize_it:
zframe_destroy(&frame);
zpoller_destroy(&poller);
pData = zlist_first(listenerList);
while(pData) {

View File

@ -114,6 +114,7 @@ static rsRetVal initCZMQ(instanceData* pData) {
}
zsock_set_sndtimeo (pData->sock, pData->sendTimeout);
if(runModConf->authType) {
if (!strcmp((const char *)runModConf->authType, "CURVESERVER")) {
zcert_t *serverCert = zcert_load(runModConf->serverCertPath);
if (!serverCert) {
@ -146,6 +147,7 @@ static rsRetVal initCZMQ(instanceData* pData) {
zcert_apply(clientCert, pData->sock);
zcert_destroy(&clientCert);
}
}
switch (pData->sockType) {
case ZMQ_PUB: