init_thread(__attribute__((unused)) const struct mg_context *ctx, int thread_type)
{
	DEFiRet;
	struct conn_wrkr_s *data = NULL;
	if (thread_type == 1) {
		CHKmalloc(data = calloc(1, sizeof(struct conn_wrkr_s)));
		data->pMsg = NULL;
		data->iMsg = 0;
		data->parseState.bzInitDone = 0;
		data->parseState.content_compressed = 0;
		data->parseState.inputState = eAtStrtFram;
		data->parseState.iOctetsRemain = 0;
		data->multiSub.maxElem = CONF_NUM_MULTISUB;
		data->multiSub.ppMsgs = data->pMsgs;
		data->multiSub.nElem = 0;
		data->pReadBuf = malloc(MAX_READ_BUFFER_SIZE);
		data->readBufSize = MAX_READ_BUFFER_SIZE;

		data->parseState.bzInitDone = 0;
		data->parseState.content_compressed = 0;
		data->parseState.inputState = eAtStrtFram;
		data->parseState.iOctetsRemain = 0;

		CHKmalloc(data->pMsg = calloc(1, 1 + s_iMaxLine));
		data->iMsg = 0;
		data->propRemoteAddr = NULL;
		data->pScratchBuf = NULL;
		data->scratchBufSize = 0;
	}

finalize_it:
	if (iRet != RS_RET_OK) {
		free(data);
		return NULL;
	}
	return data;
}
init_thread(__attribute__((unused)) const struct mg_context *ctx, int thread_type)
{
	DEFiRet;
	struct conn_wrkr_s *data = NULL;
	if (thread_type == 1) {
		CHKmalloc(data = calloc(1, sizeof(struct conn_wrkr_s)));
		data->pMsg = NULL;
		data->iMsg = 0;
		data->parseState.bzInitDone = 0;
		data->parseState.content_compressed = 0;
		data->parseState.inputState = eAtStrtFram;
		data->parseState.iOctetsRemain = 0;
		data->multiSub.maxElem = CONF_NUM_MULTISUB;
		data->multiSub.ppMsgs = data->pMsgs;
		data->multiSub.nElem = 0;
		data->pReadBuf = malloc(MAX_READ_BUFFER_SIZE);
		data->readBufSize = MAX_READ_BUFFER_SIZE;

		data->parseState.bzInitDone = 0;
		data->parseState.content_compressed = 0;
		data->parseState.inputState = eAtStrtFram;
		data->parseState.iOctetsRemain = 0;

		CHKmalloc(data->pMsg = calloc(1, 1 + s_iMaxLine));
		data->iMsg = 0;
		data->propRemoteAddr = NULL;
		data->pScratchBuf = NULL;
		data->scratchBufSize = 0;
	}

finalize_it:
	if (iRet != RS_RET_OK) {
		free(data);
		return NULL;
	}
	return data;
}