Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4650 - trunk/src/http/modules

Anonymous User
May 29, 2012 05:20AM
Author: ru
Date: 2012-05-29 09:19:51 +0000 (Tue, 29 May 2012)
New Revision: 4650
URL: http://trac.nginx.org/nginx/changeset/4650/nginx

Log:
geoip: got rid of ugly casts when calling ngx_free().

This is done by removing the "const" qualifier from the common return
type of handler functions returning either "const char *" or "char *".


Modified:
trunk/src/http/modules/ngx_http_geoip_module.c

Modified: trunk/src/http/modules/ngx_http_geoip_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_geoip_module.c 2012-05-28 14:20:04 UTC (rev 4649)
+++ trunk/src/http/modules/ngx_http_geoip_module.c 2012-05-29 09:19:51 UTC (rev 4650)
@@ -28,7 +28,7 @@
} ngx_http_geoip_var_t;


-typedef const char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *, u_long addr);
+typedef char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *, u_long addr);

static u_long ngx_http_geoip_addr(ngx_http_request_t *r,
ngx_http_geoip_conf_t *gcf);
@@ -292,7 +292,7 @@
(ngx_http_geoip_variable_handler_pt) data;

size_t len;
- const char *val;
+ char *val;
ngx_http_geoip_conf_t *gcf;

gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
@@ -310,7 +310,7 @@
len = ngx_strlen(val);
v->data = ngx_pnalloc(r->pool, len);
if (v->data == NULL) {
- ngx_free((void *) val);
+ ngx_free(val);
return NGX_ERROR;
}

@@ -321,7 +321,7 @@
v->no_cacheable = 0;
v->not_found = 0;

- ngx_free((void *) val);
+ ngx_free(val);

return NGX_OK;


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4650 - trunk/src/http/modules

Anonymous User 985 May 29, 2012 05:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 229
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready