APLOG_USE_MODULE(proxy);
+#define UDS_SOCKET_STRING "uds="
/*
* Opaque structure containing target server info when
* using a forward proxy.
* spilling the cached addr from the worker.
*/
if (!conn->hostname || !worker->s->is_address_reusable ||
- worker->s->disablereuse || strncmp(conn->hostname, "socket=", 7) == 0) {
+ worker->s->disablereuse || strncmp(conn->hostname, UDS_SOCKET_STRING, sizeof(UDS_SOCKET_STRING)-1) == 0) {
if (proxyname) {
conn->hostname = apr_pstrdup(conn->pool, proxyname);
conn->port = proxyport;
conn->port = uri->port;
}
socket_cleanup(conn);
- if (strncmp(conn->hostname, "socket=", 7) == 0) {
- char *uds_path = apr_pstrdup(conn->pool, conn->hostname + 7);
+ if (strncmp(conn->hostname, UDS_SOCKET_STRING, sizeof(UDS_SOCKET_STRING)-1) == 0) {
+ char *uds_path = apr_pstrdup(conn->pool, conn->hostname + sizeof(UDS_SOCKET_STRING) - 1);
decodeenc(uds_path);
conn->uds_path = uds_path;
}