Lines Matching refs:con
191 static int mod_extforward_patch_connection(server *srv, connection *con, plugin_data *p) { in mod_extforward_patch_connection() argument
204 if (!config_check_cond(srv, con, dc)) continue; in mod_extforward_patch_connection()
341 static void clean_cond_cache(server *srv, connection *con) { in clean_cond_cache() argument
342 config_cond_cache_reset_item(srv, con, COMP_HTTP_REMOTE_IP); in clean_cond_cache()
358 if (!con->request.headers) return HANDLER_GO_ON; in URIHANDLER_FUNC()
360 mod_extforward_patch_connection(srv, con, p); in URIHANDLER_FUNC()
362 if (con->conf.log_request_handling) { in URIHANDLER_FUNC()
373 …if (NULL != (forwarded = (data_string*) array_get_element(con->request.headers, ds->value->ptr))) … in URIHANDLER_FUNC()
376 forwarded = (data_string *) array_get_element(con->request.headers,"X-Forwarded-For"); in URIHANDLER_FUNC()
377 …if (NULL == forwarded) forwarded = (data_string *) array_get_element(con->request.headers, "Forwa… in URIHANDLER_FUNC()
381 if (con->conf.log_request_handling) { in URIHANDLER_FUNC()
389 dst_addr_str = inet_ntop(con->dst_addr.plain.sa_family, in URIHANDLER_FUNC()
390 con->dst_addr.plain.sa_family == AF_INET6 ? in URIHANDLER_FUNC()
391 (struct sockaddr *)&(con->dst_addr.ipv6.sin6_addr) : in URIHANDLER_FUNC()
392 (struct sockaddr *)&(con->dst_addr.ipv4.sin_addr), in URIHANDLER_FUNC()
395 dst_addr_str = inet_ntoa(con->dst_addr.ipv4.sin_addr); in URIHANDLER_FUNC()
400 if (con->conf.log_request_handling) { in URIHANDLER_FUNC()
415 server_socket *srv_sock = con->srv_socket; in URIHANDLER_FUNC()
416 …data_string *forwarded_proto = (data_string *)array_get_element(con->request.headers, "X-Forwarded… in URIHANDLER_FUNC()
424 if (con->conf.log_request_handling) { in URIHANDLER_FUNC()
447 if (con->plugin_ctx[p->id]) { in URIHANDLER_FUNC()
450 handler_ctx_free(con->plugin_ctx[p->id]); in URIHANDLER_FUNC()
451 con->plugin_ctx[p->id] = NULL; in URIHANDLER_FUNC()
454 con->plugin_ctx[p->id] = handler_ctx_init(con->dst_addr, con->dst_addr_buf); in URIHANDLER_FUNC()
456 con->dst_addr = sock; in URIHANDLER_FUNC()
457 con->dst_addr_buf = buffer_init(); in URIHANDLER_FUNC()
458 buffer_copy_string(con->dst_addr_buf, real_remote_addr); in URIHANDLER_FUNC()
460 if (con->conf.log_request_handling) { in URIHANDLER_FUNC()
465 clean_cond_cache(srv, con); in URIHANDLER_FUNC()
479 handler_ctx *hctx = con->plugin_ctx[p->id]; in CONNECTION_FUNC()
483 con->dst_addr = hctx->saved_remote_addr; in CONNECTION_FUNC()
484 buffer_free(con->dst_addr_buf); in CONNECTION_FUNC()
486 con->dst_addr_buf = hctx->saved_remote_addr_buf; in CONNECTION_FUNC()
490 con->plugin_ctx[p->id] = NULL; in CONNECTION_FUNC()
493 clean_cond_cache(srv, con); in CONNECTION_FUNC()