diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2012-11-03 19:12:59 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2012-11-03 19:12:59 +0000 |
commit | 057f859112347fb0dff7d6a03a03a424cbc2c662 (patch) | |
tree | c0ff0b048e91d08a3cb90d8dd356c9e3a90dd765 | |
parent | 431d9669147e591402c2e822a82ecd17419c3571 (diff) | |
download | libapr-057f859112347fb0dff7d6a03a03a424cbc2c662.tar.gz |
merge r1405403 from 1.5.x branch (corresponding roughly to trunk r1405402):
add apr_socket_accept_filter() notes on the name and args parameters,
which should have been declared as const char *
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@1405404 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/apr_network_io.h | 2 | ||||
-rw-r--r-- | network_io/unix/sockopt.c | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/apr_network_io.h b/include/apr_network_io.h index 0335da9d7..8b9209efd 100644 --- a/include/apr_network_io.h +++ b/include/apr_network_io.h @@ -756,6 +756,8 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); * @param name The accept filter * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. + * @bug name and args should have been declared as const char *, as they are in + * APR 2.0 */ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args); diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 3fc932f42..546f4a3fa 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -381,9 +381,13 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) } #if APR_HAS_SO_ACCEPTFILTER -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, - char *args) +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *nonconst_name, + char *nonconst_args) { + /* these should have been const; act like they are */ + const char *name = nonconst_name; + const char *args = nonconst_args; + struct accept_filter_arg af; strncpy(af.af_name, name, 16); strncpy(af.af_arg, args, 256 - 16); |