Selaa lähdekoodia

Fix #16 - compilation error on kfreebsd

This should fix the compilation error when compiling with the
-Wunused-but-set-variable gcc option.
tags/v0.8.4
Brice Figureau 14 vuotta sitten
vanhempi
commit
436ec80547
1 muutettua tiedostoa jossa 1 lisäystä ja 11 poistoa
  1. 1
    11
      ngx_http_uploadprogress_module.c

+ 1
- 11
ngx_http_uploadprogress_module.c Näytä tiedosto

449
 {
449
 {
450
     ngx_str_t                                   *id, *oldid;
450
     ngx_str_t                                   *id, *oldid;
451
     ngx_slab_pool_t                             *shpool;
451
     ngx_slab_pool_t                             *shpool;
452
-    ngx_connection_t                            *c;
453
     ngx_shm_zone_t                              *shm_zone;
452
     ngx_shm_zone_t                              *shm_zone;
454
     ngx_http_uploadprogress_ctx_t               *ctx;
453
     ngx_http_uploadprogress_ctx_t               *ctx;
455
     ngx_http_uploadprogress_node_t              *up;
454
     ngx_http_uploadprogress_node_t              *up;
458
 
457
 
459
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: ngx_http_uploadprogress_event_handler");
458
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: ngx_http_uploadprogress_event_handler");
460
     
459
     
461
-    c = r->connection;
462
-
463
     /* find node, update rest */
460
     /* find node, update rest */
464
     oldid = id = get_tracking_id(r);
461
     oldid = id = get_tracking_id(r);
465
 
462
 
1007
     ngx_http_uploadprogress_cleanup_t *upcln = data;
1004
     ngx_http_uploadprogress_cleanup_t *upcln = data;
1008
     ngx_slab_pool_t                 *shpool;
1005
     ngx_slab_pool_t                 *shpool;
1009
     ngx_rbtree_node_t               *node;
1006
     ngx_rbtree_node_t               *node;
1010
-    ngx_http_uploadprogress_ctx_t   *ctx;
1011
     ngx_http_uploadprogress_node_t  *up;
1007
     ngx_http_uploadprogress_node_t  *up;
1012
     ngx_http_request_t              *r;
1008
     ngx_http_request_t              *r;
1013
 
1009
 
1014
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upcln->shm_zone->shm.log, 0,
1010
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upcln->shm_zone->shm.log, 0,
1015
                    "uploadprogress cleanup called");
1011
                    "uploadprogress cleanup called");
1016
 
1012
 
1017
-    ctx = upcln->shm_zone->data;
1018
     shpool = (ngx_slab_pool_t *) upcln->shm_zone->shm.addr;
1013
     shpool = (ngx_slab_pool_t *) upcln->shm_zone->shm.addr;
1019
     node = upcln->node;
1014
     node = upcln->node;
1020
     r = upcln->r;
1015
     r = upcln->r;
1240
 ngx_http_uploadprogress_create_loc_conf(ngx_conf_t * cf)
1235
 ngx_http_uploadprogress_create_loc_conf(ngx_conf_t * cf)
1241
 {
1236
 {
1242
     ngx_http_uploadprogress_conf_t  *conf;
1237
     ngx_http_uploadprogress_conf_t  *conf;
1243
-    ngx_http_uploadprogress_template_t   *t;
1244
     ngx_uint_t                            i;
1238
     ngx_uint_t                            i;
1245
 
1239
 
1246
     conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uploadprogress_conf_t));
1240
     conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uploadprogress_conf_t));
1252
         return NGX_CONF_ERROR;
1246
         return NGX_CONF_ERROR;
1253
     }
1247
     }
1254
 
1248
 
1255
-    t = conf->templates.elts;
1256
     for(i = 0;i < conf->templates.nalloc; i++) {
1249
     for(i = 0;i < conf->templates.nalloc; i++) {
1257
         ngx_http_uploadprogress_template_t *elt = ngx_array_push(&conf->templates);
1250
         ngx_http_uploadprogress_template_t *elt = ngx_array_push(&conf->templates);
1258
         if (elt == NULL) {
1251
         if (elt == NULL) {
1312
 ngx_http_uploadprogress_init_variables_and_templates(ngx_conf_t *cf)
1305
 ngx_http_uploadprogress_init_variables_and_templates(ngx_conf_t *cf)
1313
 {
1306
 {
1314
     ngx_http_variable_t  *var, *v;
1307
     ngx_http_variable_t  *var, *v;
1315
-    ngx_http_uploadprogress_template_t   *t;
1316
     ngx_http_uploadprogress_state_map_t  *m;
1308
     ngx_http_uploadprogress_state_map_t  *m;
1317
-    ssize_t                               n;
1318
     ngx_uint_t                            i;
1309
     ngx_uint_t                            i;
1319
 
1310
 
1320
     /* Add variables */
1311
     /* Add variables */
1335
     }
1326
     }
1336
 
1327
 
1337
     m = ngx_http_uploadprogress_state_map;
1328
     m = ngx_http_uploadprogress_state_map;
1338
-    t = ngx_http_uploadprogress_global_templates.elts;
1339
     i = 0;
1329
     i = 0;
1340
 
1330
 
1341
     while(m->name.data != NULL) {
1331
     while(m->name.data != NULL) {
1342
         ngx_http_uploadprogress_template_t *elt = ngx_array_push(&ngx_http_uploadprogress_global_templates);
1332
         ngx_http_uploadprogress_template_t *elt = ngx_array_push(&ngx_http_uploadprogress_global_templates);
1343
-        n = ngx_http_script_variables_count(ngx_http_uploadprogress_java_defaults + i);
1333
+        ngx_http_script_variables_count(ngx_http_uploadprogress_java_defaults + i);
1344
 
1334
 
1345
         if (ngx_http_upload_progress_set_template(cf, elt, ngx_http_uploadprogress_java_defaults + i) != NGX_CONF_OK) {
1335
         if (ngx_http_upload_progress_set_template(cf, elt, ngx_http_uploadprogress_java_defaults + i) != NGX_CONF_OK) {
1346
             return NGX_ERROR;
1336
             return NGX_ERROR;

Loading…
Peruuta
Tallenna