diff -r 79ddd772e807 -r 570026d3a685 src/server/daemon/httprequest.c --- a/src/server/daemon/httprequest.c Sat May 14 15:22:37 2022 +0200 +++ b/src/server/daemon/httprequest.c Sun May 15 08:56:00 2022 +0200 @@ -579,7 +579,12 @@ // TODO: reuse buffer in next request rq->rq.rq_attr.keep_alive = 0; // workaround } - if(!rq->rq.senthdrs) { + + if(rq->rq.senthdrs) { + // flush buffer and add termination if chunked encoding + // is enabled + net_finish(sn->sn.csd); + } else { // why was no response sent? // something must have gone wrong // terminate the session @@ -898,18 +903,12 @@ } if(ret != REQ_NOACTION) { - if(ret == REQ_PROCEED) { - if(rq->rq.senthdrs) { - // flush buffer and add termination if chunked encoding - // is enabled - net_finish(sn->sn.csd); - } else { - // a service SAF must send a response - // senthdrs == 0 indicators something has gone - // wrong - protocol_status(&sn->sn, &rq->rq, 500, NULL); - ret = REQ_ABORTED; - } + if(ret == REQ_PROCEED && !rq->rq.senthdrs) { + // a service SAF must send a response + // senthdrs == 0 indicators something has gone + // wrong + protocol_status(&sn->sn, &rq->rq, 500, NULL); + ret = REQ_ABORTED; } else if(ret == REQ_PROCESSING) { // save nsapi context rq->context.objset_index = i;