Skip to content

Commit 46ba105

Browse files
authored
Merge pull request #19109 from opensourcerouting/vtysh_flush_revert
lib: revert addition of vtysh_flush() call in vty_out()
2 parents b9536ee + 1c50a1e commit 46ba105

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

lib/vty.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,8 @@ int vty_out(struct vty *vty, const char *format, ...)
346346
case VTY_SHELL_SERV:
347347
case VTY_FILE:
348348
default:
349-
vty->vty_buf_size_accumulated += strlen(filtered);
350349
/* print without crlf replacement */
351350
buffer_put(vty->obuf, (uint8_t *)filtered, strlen(filtered));
352-
/* For every chunk of memory, we invoke vtysh_flush where we
353-
* put the data of collective vty->obuf Linked List items on the
354-
* socket and free the vty->obuf data.
355-
*/
356-
if (vty->vty_buf_size_accumulated >= vty->buf_size_intermediate) {
357-
vty->vty_buf_size_accumulated = 0;
358-
vtysh_flush(vty);
359-
}
360351
break;
361352
}
362353

@@ -2174,13 +2165,6 @@ static void vtysh_accept(struct event *thread)
21742165
#endif /* VTYSH_DEBUG */
21752166

21762167
vty = vty_new();
2177-
2178-
vty->buf_size_set = ret;
2179-
if (vty->buf_size_set < VTY_MAX_INTERMEDIATE_FLUSH)
2180-
vty->buf_size_intermediate = vty->buf_size_set / 2;
2181-
else
2182-
vty->buf_size_intermediate = VTY_MAX_INTERMEDIATE_FLUSH;
2183-
21842168
vty->fd = sock;
21852169
vty->wfd = sock;
21862170
vty->type = VTY_SHELL_SERV;
@@ -2260,7 +2244,6 @@ static int vtysh_flush(struct vty *vty)
22602244
vty_close(vty);
22612245
return -1;
22622246
case BUFFER_EMPTY:
2263-
vty->vty_buf_size_accumulated = 0;
22642247
break;
22652248
}
22662249
return 0;

lib/vty.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,6 @@ struct vty {
228228
uintptr_t mgmt_req_pending_data;
229229
bool mgmt_locked_candidate_ds;
230230
bool mgmt_locked_running_ds;
231-
uint64_t vty_buf_size_accumulated;
232-
233-
int buf_size_set;
234-
uint64_t buf_size_intermediate;
235231
};
236232

237233
static inline void vty_push_context(struct vty *vty, int node, uint64_t id)
@@ -337,9 +333,6 @@ struct vty_arg {
337333
/* Vty max send buffer size */
338334
#define VTY_SEND_BUF_MAX 16777216
339335

340-
/* Vty flush intermediate size */
341-
#define VTY_MAX_INTERMEDIATE_FLUSH 131072
342-
343336
/* Directory separator. */
344337
#ifndef DIRECTORY_SEP
345338
#define DIRECTORY_SEP '/'

0 commit comments

Comments
 (0)