chiark / gitweb /
socket: suffix newly added TCP sockopt time properties with "Sec"
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Aug 2014 19:57:37 +0000 (21:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Aug 2014 19:58:48 +0000 (21:58 +0200)
This is what we have done so far for all other time values, and hence we
should do this here. This indicates the default unit of time values
specified here, if they don't contain a unit.

man/systemd.socket.xml
src/core/dbus-socket.c
src/core/load-fragment-gperf.gperf.m4
src/core/socket.c

index 4483905..238029a 100644 (file)
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>KeepAliveTime=</varname></term>
+                                <term><varname>KeepAliveTimeSec=</varname></term>
                                 <listitem><para>Takes time (in seconds) as argument . The connection needs to remain
                                 idle before TCP starts sending keepalive probes. This controls the TCP_KEEPIDLE
                                 socket option (see
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>KeepAliveInterval=</varname></term>
+                                <term><varname>KeepAliveIntervalSec=</varname></term>
                                 <listitem><para>Takes time (in seconds) as argument between individual keepalive probes,
                                 if the socket option SO_KEEPALIVE has  been set on this socket seconds as argument.
                                 This controls the TCP_KEEPINTVL socket option (see
                         </varlistentry>
 
                         <varlistentry>
-                                <term><varname>DeferAccept=</varname></term>
+                                <term><varname>DeferAcceptSec=</varname></term>
 
                                 <listitem><para>Takes time (in
                                 seconds) as argument. If set, the
index e9e2430..50b1674 100644 (file)
@@ -97,10 +97,10 @@ const sd_bus_vtable bus_socket_vtable[] = {
         SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Socket, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Accept", "b", bus_property_get_bool, offsetof(Socket, accept), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KeepAlive", "b", bus_property_get_bool, offsetof(Socket, keep_alive), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("KeepAliveTime", "t", bus_property_get_usec, offsetof(Socket, keep_alive_time), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("KeepAliveInterval", "t", bus_property_get_usec, offsetof(Socket, keep_alive_interval), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("KeepAliveTimeUSec", "t", bus_property_get_usec, offsetof(Socket, keep_alive_time), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("KeepAliveIntervalUSec", "t", bus_property_get_usec, offsetof(Socket, keep_alive_interval), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KeepAliveProbes", "u", bus_property_get_unsigned, offsetof(Socket, keep_alive_cnt), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("DeferAccept" , "t", bus_property_get_usec, offsetof(Socket, defer_accept), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("DeferAcceptUSec" , "t", bus_property_get_usec, offsetof(Socket, defer_accept), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("NoDelay", "b", bus_property_get_bool, offsetof(Socket, no_delay), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Priority", "i", bus_property_get_int, offsetof(Socket, priority), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("ReceiveBuffer", "t", bus_property_get_size, offsetof(Socket, receive_buffer), SD_BUS_VTABLE_PROPERTY_CONST),
index b4e2b25..24aa80d 100644 (file)
@@ -231,10 +231,10 @@ Socket.DirectoryMode,            config_parse_mode,                  0,
 Socket.Accept,                   config_parse_bool,                  0,                             offsetof(Socket, accept)
 Socket.MaxConnections,           config_parse_unsigned,              0,                             offsetof(Socket, max_connections)
 Socket.KeepAlive,                config_parse_bool,                  0,                             offsetof(Socket, keep_alive)
-Socket.KeepAliveTime,            config_parse_sec,                   0,                             offsetof(Socket, keep_alive_time)
-Socket.KeepAliveInterval,        config_parse_sec,                   0,                             offsetof(Socket, keep_alive_interval)
+Socket.KeepAliveTimeSec,         config_parse_sec,                   0,                             offsetof(Socket, keep_alive_time)
+Socket.KeepAliveIntervalSec,     config_parse_sec,                   0,                             offsetof(Socket, keep_alive_interval)
 Socket.KeepAliveProbes,          config_parse_unsigned,              0,                             offsetof(Socket, keep_alive_cnt)
-Socket.DeferAccept,              config_parse_sec,                   0,                             offsetof(Socket, defer_accept)
+Socket.DeferAcceptSec,           config_parse_sec,                   0,                             offsetof(Socket, defer_accept)
 Socket.NoDelay,                  config_parse_bool,                  0,                             offsetof(Socket, no_delay)
 Socket.Priority,                 config_parse_int,                   0,                             offsetof(Socket, priority)
 Socket.ReceiveBuffer,            config_parse_iec_size,              0,                             offsetof(Socket, receive_buffer)
index a16b20d..1189f45 100644 (file)
@@ -596,28 +596,25 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
                         prefix, strna(s->user),
                         prefix, strna(s->group));
 
-        if(s->keep_alive_time)
+        if (s->keep_alive_time > 0)
                 fprintf(f,
-                        "%sKeepAliveTime: %s\n",
-                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX,
-                                                s->keep_alive_time, USEC_PER_SEC));
+                        "%sKeepAliveTimeSec: %s\n",
+                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX, s->keep_alive_time, USEC_PER_SEC));
 
-        if(s->keep_alive_interval)
+        if (s->keep_alive_interval)
                 fprintf(f,
-                        "%sKeepAliveInterval: %s\n",
-                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX,
-                                                s->keep_alive_interval, USEC_PER_SEC));
+                        "%sKeepAliveIntervalSec: %s\n",
+                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX, s->keep_alive_interval, USEC_PER_SEC));
 
-        if(s->keep_alive_cnt)
+        if (s->keep_alive_cnt)
                 fprintf(f,
                         "%sKeepAliveProbes: %u\n",
                         prefix, s->keep_alive_cnt);
 
-        if(s->defer_accept)
+        if (s->defer_accept)
                 fprintf(f,
-                        "%sDeferAccept: %s\n",
-                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX,
-                                                s->defer_accept, USEC_PER_SEC));
+                        "%sDeferAcceptSec: %s\n",
+                        prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX, s->defer_accept, USEC_PER_SEC));
 
         LIST_FOREACH(port, p, s->ports) {