@@ -37,7 +37,7 @@ typedef struct {
3737 ngx_str_t cert_url ;
3838 ngx_str_t validity_url ;
3939 ngx_str_t cert_path ;
40- size_t expires_seconds ;
40+ time_t expiry_seconds ;
4141 sxg_signer_list_t signers ;
4242 ngx_sxg_cert_chain_t cert_chain ;
4343} ngx_http_sxg_loc_conf_t ;
@@ -100,9 +100,9 @@ static ngx_command_t ngx_http_sxg_commands[] = {
100100 {ngx_string ("sxg_cert_path" ), NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ,
101101 ngx_conf_set_str_slot , NGX_HTTP_LOC_CONF_OFFSET ,
102102 offsetof(ngx_http_sxg_loc_conf_t , cert_path ), NULL },
103- {ngx_string ("sxg_expires_seconds " ), NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ,
104- ngx_conf_set_size_slot , NGX_HTTP_LOC_CONF_OFFSET ,
105- offsetof(ngx_http_sxg_loc_conf_t , expires_seconds ), NULL },
103+ {ngx_string ("sxg_expiry_seconds " ), NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ,
104+ ngx_conf_set_sec_slot , NGX_HTTP_LOC_CONF_OFFSET ,
105+ offsetof(ngx_http_sxg_loc_conf_t , expiry_seconds ), NULL },
106106 ngx_null_command };
107107
108108static ngx_http_module_t ngx_http_sxg_filter_module_ctx = {
@@ -155,7 +155,7 @@ static void* ngx_http_sxg_create_loc_conf(ngx_conf_t* cf) {
155155 slc -> validity_url = (ngx_str_t ){.data = NULL , .len = 0 };
156156 slc -> cert_path = (ngx_str_t ){.data = NULL , .len = 0 };
157157 slc -> cert_chain = ngx_sxg_empty_cert_chain ();
158- slc -> expires_seconds = NGX_CONF_UNSET_SIZE ;
158+ slc -> expiry_seconds = NGX_CONF_UNSET ;
159159 slc -> signers = sxg_empty_signer_list ();
160160 return slc ;
161161}
@@ -172,8 +172,8 @@ static char* ngx_http_sxg_merge_loc_conf(ngx_conf_t* cf, void* parent,
172172 ngx_conf_merge_str_value (conf -> cert_url , prev -> cert_url , "" );
173173 ngx_conf_merge_str_value (conf -> validity_url , prev -> validity_url , "" );
174174 ngx_conf_merge_str_value (conf -> cert_path , prev -> cert_path , "" );
175- ngx_conf_merge_size_value (conf -> expires_seconds , prev -> expires_seconds ,
176- 60 * 60 * 24 ); // 1 day.
175+ ngx_conf_merge_sec_value (conf -> expiry_seconds , prev -> expiry_seconds ,
176+ 60 * 60 * 24 ); // 1 day.
177177
178178 if (!is_valid_config (cf , conf )) {
179179 if (conf -> enable ) {
@@ -225,11 +225,11 @@ static char* ngx_http_sxg_merge_loc_conf(ngx_conf_t* cf, void* parent,
225225 }
226226 }
227227
228- if (conf -> expires_seconds > 60 * 60 * 24 * 7 ) {
228+ if (conf -> expiry_seconds > 60 * 60 * 24 * 7 ) {
229229 // SXG life-span longer than 7 days is not allowed by spec.
230230 ngx_log_error (NGX_LOG_EMERG , cf -> log , 0 ,
231231 "nginx-sxg-module: too long lifespan of SXG %d seconds" ,
232- conf -> expires_seconds );
232+ conf -> expiry_seconds );
233233 return NGX_CONF_ERROR ;
234234 }
235235
@@ -275,7 +275,7 @@ static bool generate_sxg(const ngx_http_request_t* req,
275275 // Set parameters.
276276 sxg_signer_t * const signer = & slc -> signers .signers [0 ];
277277 signer -> date = time (NULL );
278- signer -> expires = signer -> date + slc -> expires_seconds ;
278+ signer -> expires = signer -> date + slc -> expiry_seconds ;
279279
280280 // Generate SXG.
281281 char * const fallback_url = construct_fallback_url (req );
0 commit comments