[core] code cleanup due to the long messages bugfix;

v0.5.xx
Alexander Vdolainen 9 years ago
parent bc3d8eef39
commit deb7c4242f

@ -346,8 +346,6 @@ static int __verify_certcall(int preverify_ok, X509_STORE_CTX *ctx)
if(!depth) { if(!depth) {
co->pctx->certid = co->pctx->certid =
ASN1_INTEGER_get((const ASN1_INTEGER *)X509_get_serialNumber(ctx->current_cert)); 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 */ /* now we're need to check the ssl cert */
if(ssys->validate_sslpem) { if(ssys->validate_sslpem) {
if(ssys->validate_sslpem(co)) return 0; 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; if(builtin) rpc_list = co->ssys->stream_rpc;
else rpc_list = co->ssys->system_rpc; else rpc_list = co->ssys->system_rpc;
if(sx->ty == SEXP_LIST) if(sx->ty == SEXP_LIST) rpcf = sx->list->val;
rpcf = sx->list->val;
else return SXE_BADPROTO; else return SXE_BADPROTO;
/* TODO: add builtin functions processing */
/* find an appropriate function */ /* find an appropriate function */
node = usrtc_lookup(rpc_list->rpc_tree, rpcf); 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); } else printf("connread(payload) µS: %ld\n", end.tv_usec - beg.tv_usec);
#endif #endif
if(rd == -1) goto __sslproto_error; }
else pthread_mutex_unlock(&(co->sslinout[0])); 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]));
/* take a message */ /* take a message */
if(mhead->attr & SXMSG_PROTO) { /* protocol message i.e. channel open/close */ if(mhead->attr & SXMSG_PROTO) { /* protocol message i.e. channel open/close */
/* ok, check up the side */ /* ok, check up the side */

Loading…
Cancel
Save