You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by zwoop <gi...@git.apache.org> on 2016/05/05 14:35:00 UTC

[GitHub] trafficserver pull request: Ts 4401

GitHub user zwoop opened a pull request:

    https://github.com/apache/trafficserver/pull/616

    Ts 4401

    I've split this into four commits (two cleanup, two features):
    
    1) Modify the clang-format for a couple of initializers, by appending a trailing ,. This is the recommended way from clang-format to enforce this behavior (they opted not to have a config).
    
    2) Reordered some switch statements, to follow the enum cardinality.
    
    3) Make proxy.config.http.uncacheable_requests_bypass_parent overridable.
    
    4) Make proxy.config.http.parent_proxy.total_connect_attempts overridable.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zwoop/trafficserver TS-4401

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/616.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #616
    
----
commit b062368dbc89cf90977f498f7e4ed2277aa0fd3f
Author: Leif Hedstrom <zw...@apache.org>
Date:   2016-04-30T18:10:09Z

    TS-4401 Fix clang-format indentation

commit 4f199d38ddacd8b1b0be7f73ce1e9e1e6df68713
Author: Leif Hedstrom <zw...@apache.org>
Date:   2016-04-30T18:10:26Z

    TS-4401 Cleanup of the overridable switch statement
    
    This does two things:
    
    1) It fixes a couple of places where the type is set to
    MgmtInt, when in reality they are MgmtByte's (and vice
    versa).
    
    2) Reorder the case statements, to be inline with the
    cardinality of the enum type.

commit 06a3401ed3ea0ca7decfb5f650b6e3bcae018a82
Author: Leif Hedstrom <zw...@apache.org>
Date:   2016-04-30T18:58:58Z

    TS-4401 Override proxy.config.http.uncacheable_requests_bypass_parent

commit e93be91d5e1b7979172f87019c7924fdecee8192
Author: Leif Hedstrom <zw...@apache.org>
Date:   2016-04-30T22:16:32Z

    TS-4401 Override proxy.config.http.parent_proxy.total_connect_attempts

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62198973
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    Also, if we do this .clang-format change, we should back port it to 6.2.0 right now, it'll save the RM for the 6.2.x LTS from headaches in the future.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62198679
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    oh, I see. Yeah, I don't think that works, the trailing comma isn't allowed in initializers :-/. So, this is an all or nothing thing, i.e. we'd have to change the .clang-format config file :-/. The other option is to not clang-format these initializers, but I really don't like to use that, because it allows for future mess (because we know we can't format manually).
    
    If we make the change to .clang-format, the diff is large, but not obscene: http://paste.fedoraproject.org/362988/60098146/
    
    
    I think if we do this though, we should make a separate Jira / PR, right? I'm +1 on this btw.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62197664
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    Well we made compromises :)
    
    Since the list is so long, can we make a similar change to the one you have don't for array initializers:
    
    ```C
    no_dns_forward_to_parent(0),
    no_origin_server_dns(0),
    use_client_target_addr(0),
    use_client_source_port(0),
    ```
    
    Not proposing a general change in standards, just making a special case for this instance since it is so hard to read all the initializers.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62197293
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    What did you have in mind? There are some options here, but this is the format we've agreed on since day one, no? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop closed the pull request at:

    https://github.com/apache/trafficserver/pull/616


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62196297
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -363,27 +363,28 @@ struct OverridableHttpConfigParams {
         : maintain_pristine_host_hdr(1), chunking_enabled(1), negative_caching_enabled(0), negative_revalidating_enabled(0),
           cache_when_to_revalidate(0), keep_alive_enabled_in(1), keep_alive_enabled_out(1), keep_alive_post_out(1),
           server_session_sharing_match(TS_SERVER_SESSION_SHARING_MATCH_BOTH), auth_server_session_private(1),
    -      fwd_proxy_auth_to_parent(0), insert_age_in_response(1), anonymize_remove_from(0), anonymize_remove_referer(0),
    -      anonymize_remove_user_agent(0), anonymize_remove_cookie(0), anonymize_remove_client_ip(0), anonymize_insert_client_ip(1),
    -      proxy_response_server_enabled(1), proxy_response_hsts_max_age(-1), proxy_response_hsts_include_subdomains(0),
    -      insert_squid_x_forwarded_for(1), send_http11_requests(1), cache_http(1), cache_cluster_cache_local(0),
    -      cache_ignore_client_no_cache(1), cache_ignore_client_cc_max_age(0), cache_ims_on_client_no_cache(1),
    -      cache_ignore_server_no_cache(0), cache_responses_to_cookies(1), cache_ignore_auth(0), cache_urls_that_look_dynamic(1),
    -      cache_required_headers(2), cache_range_lookup(1), cache_range_write(0), insert_request_via_string(1),
    -      insert_response_via_string(0), doc_in_cache_skip_dns(1), flow_control_enabled(0), accept_encoding_filter_enabled(0),
    -      normalize_ae_gzip(0), negative_caching_lifetime(1800), negative_revalidating_lifetime(1800), sock_recv_buffer_size_out(0),
    -      sock_send_buffer_size_out(0), sock_option_flag_out(0), sock_packet_mark_out(0), sock_packet_tos_out(0),
    -      server_tcp_init_cwnd(0), request_hdr_max_size(131072), response_hdr_max_size(131072), post_check_content_length_enabled(1),
    -      cache_heuristic_min_lifetime(3600), cache_heuristic_max_lifetime(86400), cache_guaranteed_min_lifetime(0),
    -      cache_guaranteed_max_lifetime(31536000), cache_max_stale_age(604800), keep_alive_no_activity_timeout_in(115),
    -      keep_alive_no_activity_timeout_out(120), transaction_no_activity_timeout_in(30), transaction_no_activity_timeout_out(30),
    -      transaction_active_timeout_out(0), websocket_active_timeout(3600), websocket_inactive_timeout(600), origin_max_connections(0),
    -      origin_max_connections_queue(0), attach_server_session_to_client(0), connect_attempts_max_retries(0),
    -      connect_attempts_max_retries_dead_server(3), connect_attempts_rr_retries(3), connect_attempts_timeout(30),
    -      post_connect_attempts_timeout(1800), down_server_timeout(300), client_abort_threshold(10), freshness_fuzz_time(240),
    -      freshness_fuzz_min_time(0), max_cache_open_read_retries(-1), cache_open_read_retry_time(10), cache_generation_number(-1),
    -      max_cache_open_write_retries(1), background_fill_active_timeout(60), http_chunking_size(4096), flow_high_water_mark(0),
    -      flow_low_water_mark(0), default_buffer_size_index(8), default_buffer_water_mark(32768), slow_log_threshold(0),
    +      fwd_proxy_auth_to_parent(0), uncacheable_requests_bypass_parent(1), insert_age_in_response(1), anonymize_remove_from(0),
    +      anonymize_remove_referer(0), anonymize_remove_user_agent(0), anonymize_remove_cookie(0), anonymize_remove_client_ip(0),
    +      anonymize_insert_client_ip(1), proxy_response_server_enabled(1), proxy_response_hsts_max_age(-1),
    +      proxy_response_hsts_include_subdomains(0), insert_squid_x_forwarded_for(1), send_http11_requests(1), cache_http(1),
    +      cache_cluster_cache_local(0), cache_ignore_client_no_cache(1), cache_ignore_client_cc_max_age(0),
    +      cache_ims_on_client_no_cache(1), cache_ignore_server_no_cache(0), cache_responses_to_cookies(1), cache_ignore_auth(0),
    +      cache_urls_that_look_dynamic(1), cache_required_headers(2), cache_range_lookup(1), cache_range_write(0),
    +      insert_request_via_string(1), insert_response_via_string(0), doc_in_cache_skip_dns(1), flow_control_enabled(0),
    +      accept_encoding_filter_enabled(0), normalize_ae_gzip(0), negative_caching_lifetime(1800),
    +      negative_revalidating_lifetime(1800), sock_recv_buffer_size_out(0), sock_send_buffer_size_out(0), sock_option_flag_out(0),
    +      sock_packet_mark_out(0), sock_packet_tos_out(0), server_tcp_init_cwnd(0), request_hdr_max_size(131072),
    +      response_hdr_max_size(131072), post_check_content_length_enabled(1), cache_heuristic_min_lifetime(3600),
    +      cache_heuristic_max_lifetime(86400), cache_guaranteed_min_lifetime(0), cache_guaranteed_max_lifetime(31536000),
    +      cache_max_stale_age(604800), keep_alive_no_activity_timeout_in(115), keep_alive_no_activity_timeout_out(120),
    +      transaction_no_activity_timeout_in(30), transaction_no_activity_timeout_out(30), transaction_active_timeout_out(0),
    +      websocket_active_timeout(3600), websocket_inactive_timeout(600), origin_max_connections(0), origin_max_connections_queue(0),
    +      attach_server_session_to_client(0), connect_attempts_max_retries(0), connect_attempts_max_retries_dead_server(3),
    +      connect_attempts_rr_retries(3), connect_attempts_timeout(30), post_connect_attempts_timeout(1800), down_server_timeout(300),
    +      client_abort_threshold(10), freshness_fuzz_time(240), freshness_fuzz_min_time(0), max_cache_open_read_retries(-1),
    +      cache_open_read_retry_time(10), cache_generation_number(-1), max_cache_open_write_retries(1),
    +      background_fill_active_timeout(60), http_chunking_size(4096), flow_high_water_mark(0), flow_low_water_mark(0),
    +      default_buffer_size_index(8), default_buffer_water_mark(32768), slow_log_threshold(0),
    --- End diff --
    
    Could you make a clang-format commit so that these are one element per line. That would make it easier to read and diffs would be better.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62205125
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    Yeh I was just thinking about using ``clang-format off``, but I'm happy to land this and then do the global clang-format change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: Ts 4401

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/616#discussion_r62196384
  
    --- Diff: proxy/http/HttpConfig.h ---
    @@ -851,8 +852,8 @@ extern volatile int32_t icp_dynamic_enabled;
     /////////////////////////////////////////////////////////////
     inline HttpConfigParams::HttpConfigParams()
       : proxy_hostname(NULL), proxy_hostname_len(0), server_max_connections(0), origin_min_keep_alive_connections(0),
    -    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0), no_dns_forward_to_parent(0),
    -    uncacheable_requests_bypass_parent(1), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    +    max_websocket_connections(-1), disable_ssl_parenting(0), enable_url_expandomatic(0),
    +    no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), use_client_source_port(0),
    --- End diff --
    
    This would be another good candidate to clang-format.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---