Ver Fonte

jsonrpcs: extra debug messages when rpc response is sent

Daniel-Constantin Mierla há 8 anos atrás
pai
commit
fa50c85a9e
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      src/modules/jsonrpcs/jsonrpcs_mod.c

+ 4 - 0
src/modules/jsonrpcs/jsonrpcs_mod.c

@@ -391,6 +391,8 @@ static int jsonrpc_send(jsonrpc_ctx_t* ctx)
 		rbuf.len = strlen(rbuf.s);
 		rbuf.len = strlen(rbuf.s);
 	}
 	}
 	if (rbuf.s!=NULL) {
 	if (rbuf.s!=NULL) {
+		LM_DBG("sending response with body: %p - %d %.*s\n", ctx->msg,
+				ctx->http_code, ctx->http_text.len, ctx->http_text.s);
 		if(ctx->msg) {
 		if(ctx->msg) {
 			xhttp_api.reply(ctx->msg, ctx->http_code, &ctx->http_text,
 			xhttp_api.reply(ctx->msg, ctx->http_code, &ctx->http_text,
 				&JSONRPC_CONTENT_TYPE_HTML, &rbuf);
 				&JSONRPC_CONTENT_TYPE_HTML, &rbuf);
@@ -400,6 +402,8 @@ static int jsonrpc_send(jsonrpc_ctx_t* ctx)
 			rbuf.s=NULL;
 			rbuf.s=NULL;
 		}
 		}
 	} else {
 	} else {
+		LM_DBG("sending response without body: %p - %d %.*s\n", ctx->msg,
+				ctx->http_code, ctx->http_text.len, ctx->http_text.s);
 		if(ctx->msg) {
 		if(ctx->msg) {
 			xhttp_api.reply(ctx->msg, ctx->http_code, &ctx->http_text,
 			xhttp_api.reply(ctx->msg, ctx->http_code, &ctx->http_text,
 					NULL, NULL);
 					NULL, NULL);