static int modifyHeader2WithReply(int fd, HttpReply *reply) { Array * modparam = cc_get_mod_param_array(fd, mod); int paramcount = cc_get_mod_param_count(fd, mod); assert(modparam); struct mod_conf_param *param = NULL; int count = 0; int loop = 0; int ret = 0; int i = 0; for(i=0; i<paramcount; i++){ assert(modparam->items[i]); param = (struct mod_conf_param *)((cc_mod_param*)modparam->items[i])->param; assert(param); count = param->count; ret =0; for(loop=0; loop<count; loop++) { if(2 == param->acp[loop]->direct) { ret = modifyHeader2(param->acp[loop], reply); //must clean it when we wanna to update HttpReply struct ret++; } } } httpReplyHdrCacheClean(reply); httpReplyHdrCacheInit(reply); return 0; }
static void httpReplyClean(HttpReply * rep) { assert(rep); httpBodyClean(&rep->body); httpReplyHdrCacheClean(rep); httpHeaderClean(&rep->header); httpStatusLineClean(&rep->sline); }
void httpReplyUpdateOnNotModified(HttpReply * rep, HttpReply * freshRep) { assert(rep && freshRep); /* clean cache */ httpReplyHdrCacheClean(rep); /* update raw headers */ httpHeaderUpdate(&rep->header, &freshRep->header, (const HttpHeaderMask *) &Denied304HeadersMask); /* init cache */ httpReplyHdrCacheInit(rep); }