diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-orders.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c index 83ca09f9..576b9ed8 100644 --- a/src/backend/taler-merchant-httpd_private-get-orders.c +++ b/src/backend/taler-merchant-httpd_private-get-orders.c @@ -515,33 +515,6 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, TALER_EC_GENERIC_PARAMETER_MALFORMED, "wired"); { - const char *start_row_str; - - start_row_str = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "start"); - if (NULL == start_row_str) - { - of.start_row = INT64_MAX; - } - else - { - char dummy[2]; - unsigned long long ull; - - if (1 != - sscanf (start_row_str, - "%llu%1s", - &ull, - dummy)) - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "date"); - of.start_row = (uint64_t) ull; - } - } - { const char *delta_str; delta_str = MHD_lookup_connection_value (connection, @@ -593,6 +566,36 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, } } { + const char *start_row_str; + + start_row_str = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "start"); + if (NULL == start_row_str) + { + if (of.delta > 0) + of.start_row = 0; + else + of.start_row = INT64_MAX; + } + else + { + char dummy[2]; + unsigned long long ull; + + if (1 != + sscanf (start_row_str, + "%llu%1s", + &ull, + dummy)) + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "start"); + of.start_row = (uint64_t) ull; + } + } + { const char *timeout_ms_str; timeout_ms_str = MHD_lookup_connection_value (connection, |