Skip to content

Commit 9a740f2

Browse files
committed
Rename reload-push-options [sync] to [update-clients]
1 parent f7c7fb5 commit 9a740f2

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/openvpn/manage.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ man_help(void)
137137
msg(M_CLIENT, "push-update-broad options : Broadcast a message to update the specified options.");
138138
msg(M_CLIENT, " Ex. push-update-broad \"route something, -dns\"");
139139
msg(M_CLIENT, "push-update-cid CID options : Send an update message to the client identified by CID.");
140-
msg(M_CLIENT, "reload-push-options [sync] : Reload push options from config file for new clients.");
141-
msg(M_CLIENT, " With 'sync': also sync options to connected clients (add new, remove old).");
140+
msg(M_CLIENT, "reload-push-options [update-clients] : Reload push options from config file for new clients.");
141+
msg(M_CLIENT, " With 'update-clients': also update connected clients (add new, remove old).");
142142
msg(M_CLIENT, "END");
143143
}
144144

@@ -1729,13 +1729,13 @@ man_dispatch_command(struct management *man, struct status_output *so, const cha
17291729
{
17301730
if (man->persist.callback.reload_push_options)
17311731
{
1732-
bool sync = (p[1] && streq(p[1], "sync"));
1733-
bool status = (*man->persist.callback.reload_push_options)(man->persist.callback.arg, sync);
1732+
bool update_clients = (p[1] && streq(p[1], "update-clients"));
1733+
bool status = (*man->persist.callback.reload_push_options)(man->persist.callback.arg, update_clients);
17341734
if (status)
17351735
{
1736-
if (sync)
1736+
if (update_clients)
17371737
{
1738-
msg(M_CLIENT, "SUCCESS: push options reloaded and synced to all clients");
1738+
msg(M_CLIENT, "SUCCESS: push options reloaded and sent to all clients");
17391739
}
17401740
else
17411741
{

src/openvpn/manage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ struct management_callback
198198
bool (*remote_entry_get)(void *arg, unsigned int index, char **remote);
199199
bool (*push_update_broadcast)(void *arg, const char *options);
200200
bool (*push_update_by_cid)(void *arg, unsigned long cid, const char *options);
201-
bool (*reload_push_options)(void *arg, bool sync);
201+
bool (*reload_push_options)(void *arg, bool update_clients);
202202
};
203203

204204
/*

src/openvpn/multi.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4173,11 +4173,11 @@ find_updatable_option_index(const char *option)
41734173
* function runs sequentially with all other operations.
41744174
*
41754175
* @param arg Pointer to multi_context
4176-
* @param sync If true, sync options to connected clients (add new, remove old)
4176+
* @param update_clients If true, update connected clients (add new, remove old)
41774177
* @return true on success, false on failure
41784178
*/
41794179
static bool
4180-
management_callback_reload_push_options(void *arg, bool sync)
4180+
management_callback_reload_push_options(void *arg, bool update_clients)
41814181
{
41824182
struct multi_context *m = (struct multi_context *)arg;
41834183
struct gc_arena gc = gc_new();
@@ -4192,7 +4192,7 @@ management_callback_reload_push_options(void *arg, bool sync)
41924192
goto cleanup;
41934193
}
41944194

4195-
/* Save reference to old push_list for sync comparison */
4195+
/* Save reference to old push_list for update comparison */
41964196
struct push_list old_push_list = m->top.options.push_list;
41974197

41984198
/* Create a temporary options structure to parse the config */
@@ -4241,9 +4241,9 @@ management_callback_reload_push_options(void *arg, bool sync)
42414241
/* Free the temporary options gc_arena (parsed config) */
42424242
gc_free(&new_options.gc);
42434243

4244-
/* Sync options to connected clients if requested */
4244+
/* Update connected clients if requested */
42454245
/* We do this BEFORE swapping the lists so we can compare old vs new */
4246-
if (sync)
4246+
if (update_clients)
42474247
{
42484248
/* Calculate required buffer size: sum of all option lengths + separators */
42494249
size_t opts_size = 0;
@@ -4284,11 +4284,11 @@ management_callback_reload_push_options(void *arg, bool sync)
42844284
{
42854285
type_removed[type_idx] = true;
42864286
removed++;
4287-
msg(D_PUSH, "MANAGEMENT: Sync removing: %s", old_e->option);
4287+
msg(D_PUSH, "MANAGEMENT: Removing: %s", old_e->option);
42884288
}
42894289
else
42904290
{
4291-
msg(M_WARN, "MANAGEMENT: Cannot sync removal of option '%s' (not updatable)", old_e->option);
4291+
msg(M_WARN, "MANAGEMENT: Cannot remove option '%s' (not updatable)", old_e->option);
42924292
}
42934293
}
42944294
}
@@ -4332,13 +4332,13 @@ management_callback_reload_push_options(void *arg, bool sync)
43324332
{
43334333
should_send = true;
43344334
added++;
4335-
msg(D_PUSH, "MANAGEMENT: Sync adding: %s", new_e->option);
4335+
msg(D_PUSH, "MANAGEMENT: Adding: %s", new_e->option);
43364336
}
43374337
/* Also resend options if their type was reset (because we sent -type) */
43384338
else if (type_was_reset)
43394339
{
43404340
should_send = true;
4341-
msg(D_PUSH, "MANAGEMENT: Sync re-adding (type reset): %s", new_e->option);
4341+
msg(D_PUSH, "MANAGEMENT: Re-adding (type reset): %s", new_e->option);
43424342
}
43434343

43444344
if (should_send)
@@ -4356,13 +4356,13 @@ management_callback_reload_push_options(void *arg, bool sync)
43564356

43574357
if (BLEN(&opts) > 0)
43584358
{
4359-
msg(M_INFO, "MANAGEMENT: Syncing push options to clients (added=%d, removed=%d)",
4359+
msg(M_INFO, "MANAGEMENT: Updating clients with push options (added=%d, removed=%d)",
43604360
added, removed);
43614361
management_callback_send_push_update_broadcast(m, BSTR(&opts));
43624362
}
43634363
else
43644364
{
4365-
msg(M_INFO, "MANAGEMENT: No changes to sync to clients");
4365+
msg(M_INFO, "MANAGEMENT: No changes to send to clients");
43664366
}
43674367
}
43684368

0 commit comments

Comments
 (0)