Project

General

Profile

Bug #2793 ยป tmp.diff

Fix using a new plugin slot - rmilecki, 2017-02-20 20:09

View differences:

src/mod_cgi.c
386 386
	return 0;
387 387
}
388 388

  
389

  
390 389
static int cgi_demux_response(server *srv, handler_ctx *hctx) {
391 390
	plugin_data *p    = hctx->plugin_data;
392 391
	connection  *con  = hctx->remote_conn;
......
560 559
							}
561 560

  
562 561
							connection_response_reset(srv, con); /*(includes con->http_status = 0)*/
562
							plugins_call_response_reset(srv, con);
563 563

  
564 564
							con->mode = DIRECT;
565 565
							return FDEVENT_HANDLED_COMEBACK;
src/mod_rewrite.c
332 332
	return 0;
333 333
}
334 334

  
335
URIHANDLER_FUNC(mod_rewrite_response_reset) {
336
	UNUSED(srv);
337
	plugin_data *p = p_d;
338

  
339
	if (con->plugin_ctx[p->id]) {
340
		handler_ctx *hctx = con->plugin_ctx[p->id];
341

  
342
		hctx->state = REWRITE_STATE_UNSET;
343
		hctx->loops = 0;
344
	}
345

  
346
	return 0;
347
}
348

  
335 349
URIHANDLER_FUNC(mod_rewrite_con_reset) {
336 350
	plugin_data *p = p_d;
337 351

  
......
505 519
	p->handle_uri_raw = mod_rewrite_uri_handler;
506 520
	p->handle_physical = mod_rewrite_physical;
507 521
	p->cleanup     = mod_rewrite_free;
522
	p->response_reset = mod_rewrite_response_reset;
508 523
	p->connection_reset = mod_rewrite_con_reset;
509 524
#endif
510 525
	p->set_defaults = mod_rewrite_set_defaults;
src/plugin.c
43 43
	PLUGIN_FUNC_HANDLE_RESPONSE_START,
44 44
	PLUGIN_FUNC_HANDLE_DOCROOT,
45 45
	PLUGIN_FUNC_HANDLE_PHYSICAL,
46
	PLUGIN_FUNC_RESPONSE_RESET,
46 47
	PLUGIN_FUNC_CONNECTION_RESET,
47 48
	PLUGIN_FUNC_INIT,
48 49
	PLUGIN_FUNC_CLEANUP,
......
336 337
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_RESPONSE_START, handle_response_start)
337 338
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_DOCROOT, handle_docroot)
338 339
PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_PHYSICAL, handle_physical)
340
PLUGIN_TO_SLOT(PLUGIN_FUNC_RESPONSE_RESET, response_reset)
339 341
PLUGIN_TO_SLOT(PLUGIN_FUNC_CONNECTION_RESET, connection_reset)
340 342

  
341 343
#undef PLUGIN_TO_SLOT
......
467 469
		PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_RESPONSE_START, handle_response_start);
468 470
		PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_DOCROOT, handle_docroot);
469 471
		PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_PHYSICAL, handle_physical);
472
		PLUGIN_TO_SLOT(PLUGIN_FUNC_RESPONSE_RESET, response_reset);
470 473
		PLUGIN_TO_SLOT(PLUGIN_FUNC_CONNECTION_RESET, connection_reset);
471 474
		PLUGIN_TO_SLOT(PLUGIN_FUNC_CLEANUP, cleanup);
472 475
		PLUGIN_TO_SLOT(PLUGIN_FUNC_SET_DEFAULTS, set_defaults);
src/plugin.h
54 54
											    */
55 55
	handler_t (* handle_subrequest)      (server *srv, connection *con, void *p_d);    /* */
56 56
	handler_t (* handle_response_start)  (server *srv, connection *con, void *p_d);    /* before response headers are written */
57
	handler_t (* response_reset)         (server *srv, connection *con, void *p_d);    /* */
57 58
	handler_t (* connection_reset)       (server *srv, connection *con, void *p_d);    /* */
58 59
	void *data;
59 60

  
    (1-1/1)