예제 #1
0
파일: mod_header.c 프로젝트: selecli/squid
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;
}
예제 #2
0
static void
httpReplyClean(HttpReply * rep)
{
    assert(rep);
    httpBodyClean(&rep->body);
    httpReplyHdrCacheClean(rep);
    httpHeaderClean(&rep->header);
    httpStatusLineClean(&rep->sline);
}
예제 #3
0
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);
}