On 2015-02-11 15:31, da...@mandelberg.org wrote:
> From: David Mandelberg <da...@mandelberg.org>
> 
> RFC 6810, Section 6.4 indicates that we should send No Data Available
> instead of a Cache Reset in this case. Either way works fine in
> practice, but we should follow the spec.

Looks good.

Reviewed-by: Richard Hansen <rhan...@bbn.com>

-Richard


> 
> addresses [#4]
> ---
>  lib/db/clients/rtr.c                             | 9 +++++----
>  tests/subsystem/rtr/response.no_data.log.correct | 4 ++--
>  tests/subsystem/rtr/test.sh.in                   | 2 +-
>  3 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/db/clients/rtr.c b/lib/db/clients/rtr.c
> index c1583c1..1fb2a96 100644
> --- a/lib/db/clients/rtr.c
> +++ b/lib/db/clients/rtr.c
> @@ -702,9 +702,10 @@ int db_rtr_serial_query_init(
>      }
>  
>      // If rtr_update is not empty, then send cache reset.
> -    // If rtr_update is empty, then send cache-reset.
> -    // By spec, this could send not-ready, but rtr-client's session_id and
> -    // serial_num will never become valid.
> +    // If rtr_update is empty, then send no-data-available.
> +    // The session_id and serial_num will never become valid in the
> +    // second case, but RFC6810 section 6.4 says to send
> +    // no-data-available.
>      ret = hasRowsRtrUpdate(conn);
>      if (ret == -1)
>      {
> @@ -715,7 +716,7 @@ int db_rtr_serial_query_init(
>      }
>      else if (ret == 0)
>      {                           // rtr_update is empty
> -        state->bad_ser_num = 1;
> +        state->not_ready = 1;
>      }
>      else if (ret > 0)
>      {                           // rtr_update is not empty,
> diff --git a/tests/subsystem/rtr/response.no_data.log.correct 
> b/tests/subsystem/rtr/response.no_data.log.correct
> index 25b3e3d..06790be 100644
> --- a/tests/subsystem/rtr/response.no_data.log.correct
> +++ b/tests/subsystem/rtr/response.no_data.log.correct
> @@ -5,5 +5,5 @@ version 0 Error Report (No Data), length = 24, encapsulated 
> PDU length = 8, erro
>  --- expecting: Cache Reset
>  version 0 Cache Reset, length = 8
>  --- serial_query 42 0
> ---- expecting: Cache Reset
> -version 0 Cache Reset, length = 8
> +--- expecting: No Data Available
> +version 0 Error Report (No Data), length = 28, encapsulated PDU length = 12, 
> error text = [0] ""
> diff --git a/tests/subsystem/rtr/test.sh.in b/tests/subsystem/rtr/test.sh.in
> index 271b488..01c7286 100644
> --- a/tests/subsystem/rtr/test.sh.in
> +++ b/tests/subsystem/rtr/test.sh.in
> @@ -271,7 +271,7 @@ start_rtrd
>  start_test no_data
>  client "reset_query" "No Data Available"
>  client "serial_query $WRONG_SESSION 0" "Cache Reset"
> -client "serial_query $SESSION 0" "Cache Reset"
> +client "serial_query $SESSION 0" "No Data Available"
>  stop_test no_data
>  
>  start_test reset_query_first
> 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
rpstir-devel mailing list
rpstir-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpstir-devel

Reply via email to