From deb7c4242f1e5848f5a7f04262df940bb53cea6b Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Mon, 22 Feb 2016 04:08:26 +0200 Subject: [PATCH] [core] code cleanup due to the long messages bugfix; --- lib/sxmplv2.c | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/lib/sxmplv2.c b/lib/sxmplv2.c index ff233e7..60ccecd 100644 --- a/lib/sxmplv2.c +++ b/lib/sxmplv2.c @@ -346,8 +346,6 @@ static int __verify_certcall(int preverify_ok, X509_STORE_CTX *ctx) if(!depth) { co->pctx->certid = ASN1_INTEGER_get((const ASN1_INTEGER *)X509_get_serialNumber(ctx->current_cert)); - //X509_STORE_CTX_free(ctx); - //X509_free(ctx->current_cert); /* now we're need to check the ssl cert */ if(ssys->validate_sslpem) { if(ssys->validate_sslpem(co)) return 0; @@ -552,12 +550,9 @@ static int __eval_sysrpc(sxlink_t *co, sexp_t *sx, int builtin) if(builtin) rpc_list = co->ssys->stream_rpc; else rpc_list = co->ssys->system_rpc; - if(sx->ty == SEXP_LIST) - rpcf = sx->list->val; + if(sx->ty == SEXP_LIST) rpcf = sx->list->val; else return SXE_BADPROTO; - /* TODO: add builtin functions processing */ - /* find an appropriate function */ node = usrtc_lookup(rpc_list->rpc_tree, rpcf); @@ -826,38 +821,8 @@ static void *__sxmpl_thread(void *b) } else printf("connread(payload) µS: %ld\n", end.tv_usec - beg.tv_usec); #endif - if(rd == -1) goto __sslproto_error; - else pthread_mutex_unlock(&(co->sslinout[0])); - - if(rd != mhead->payload_length) { - mid = mhead->msgid; - /* if we're need to do something */ - if(mhead->msgid >= MAX_MSGINPROCESS) { - mhead->opcode = SXE_INVALINDEX; - goto __return_error; - } else { - // pthread_mutex_lock(&co->idx_msg_lock); - msg = co->messages[mid]; - //thread_mutex_unlock(&co->idx_msg_lock); - } - if(!msg) { - if(mhead->attr & SXMSG_OPEN) mhead->opcode = SXE_BADPROTO; - else { - if((mhead->attr & SXMSG_PROTO) || (mhead->attr & SXMSG_LINK)) - mhead->opcode = SXE_BADPROTO; - else mhead->opcode = SXE_NOSUCHMSG; - } - } - __return_error: - mhead->attr |= SXMSG_CLOSED; - mhead->payload_length = 0; - pthread_mutex_lock(&(co->sslinout[1])); - wr = __conn_write(co, mhead, sizeof(sxmplv2_head_t)); - pthread_mutex_unlock(&(co->sslinout[1])); - if(wr == -1) goto __finish; - else goto __again; - } - } else pthread_mutex_unlock(&(co->sslinout[0])); + } + pthread_mutex_unlock(&(co->sslinout[0])); /* take a message */ if(mhead->attr & SXMSG_PROTO) { /* protocol message i.e. channel open/close */ /* ok, check up the side */