summaryrefslogtreecommitdiff
path: root/memcached.c
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-10-30 15:25:07 -0700
committerdormando <dormando@rydia.net>2009-10-30 16:10:42 -0700
commit6dc28e905d7b9f7809f6e8c0e372588740c28e47 (patch)
tree27557dad7199239da27da13feb50956690a95748 /memcached.c
parentb8ff91831829221d57944eafca28cf6420485061 (diff)
downloadmemcached-6dc28e905d7b9f7809f6e8c0e372588740c28e47.tar.gz
TCP and UDP ports should follow each other. bug67
Diffstat (limited to 'memcached.c')
-rw-r--r--memcached.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/memcached.c b/memcached.c
index 2da4095..ed67eb0 100644
--- a/memcached.c
+++ b/memcached.c
@@ -4250,6 +4250,8 @@ int main (int argc, char **argv) {
/* udp socket */
static int *u_socket = NULL;
bool protocol_specified = false;
+ bool tcp_specified = false;
+ bool udp_specified = false;
/* handle SIGINT */
signal(SIGINT, sig_handler);
@@ -4297,9 +4299,11 @@ int main (int argc, char **argv) {
case 'U':
settings.udpport = atoi(optarg);
+ udp_specified = true;
break;
case 'p':
settings.port = atoi(optarg);
+ tcp_specified = true;
break;
case 's':
settings.socketpath = optarg;
@@ -4465,6 +4469,12 @@ int main (int argc, char **argv) {
}
}
+ if (tcp_specified && !udp_specified) {
+ settings.udpport = settings.port;
+ } else if (udp_specified && !tcp_specified) {
+ settings.port = settings.udpport;
+ }
+
if (maxcore != 0) {
struct rlimit rlim_new;
/*