)]}'
{
  "commit": "9fc7ebf10b7bb638ddf6d1b4b2d562dd417866fc",
  "tree": "e2e49aa4ea2530be5b86df581ed1adcd37822f3a",
  "parents": [
    "338b3424154af85b0762713796397d3f2345d54f"
  ],
  "author": {
    "name": "ajs",
    "email": "ajs",
    "time": "Wed Feb 23 15:12:34 2005 +0000"
  },
  "committer": {
    "name": "ajs",
    "email": "ajs",
    "time": "Wed Feb 23 15:12:34 2005 +0000"
  },
  "message": "2005-02-23 Andrew J. Schorr \u003cajschorr@alumni.princeton.edu\u003e\n\n\t* buffer.h: Make the struct buffer and struct buffer_data structures\n\t  private by moving them inside buffer.c.  Add comments for all\n\t  functions.  Rename buffer_write as buffer_put (to be more consistent\n\t  with the buffer_putc and buffer_putstr functions).  Declare a new\n\t  buffer_write function that is used to write data to a file descriptor\n\t  and/or add it to the buffer queue.  Remove unused function\n\t  buffer_flush_vty_all.  Create a new enum typedef buffer_status_t\n\t  to be used as the return code for all buffer_flush* functions\n\t  and buffer_write.\n\t* buffer.c: The struct buffer and struct buffer_data declarations\n\t  are now private to this file.  In conjunction with that, remove\n\t  some unnecessary fields: struct buffer (alloc, unused_head,\n\t  unused_tail, length), struct buffer_data (prev).\n\t  (buffer_data_new) Removed: functionality incorporated into buffer_add.\n\t  (buffer_data_free) Removed: use a macro BUFFER_DATA_FREE instead.\n\t  (buffer_new) Use calloc instead of malloc + memset(zero).\n\t  Supply an appropriate default size if the specified size is 0.\n\t  (buffer_free) Eliminate code duplication by calling buffer_reset to\n\t  free the contents of the buffer (and remove unused code related\n\t  to unused_head).\n\t  (buffer_empty,buffer_putc,buffer_putstr) Aesthetic change (make more\n\t  compact).\n\t  (buffer_reset) Use macro BUFFER_DATA_FREE.  No need to set\n\t  alloc and length to 0 (these fields have been removed).\n\t  (buffer_add) Fix scope to be static.  Call XMALLOC directly instead\n\t  of calling removed buffer_data_new function.  Simplify the logic\n\t  (since it\u0027s now a singly-linked list instead of doubly-linked).\n\t  (buffer_write) Renamed to buffer_put.  Change to void, since return\n\t  code of 1 was meaningless.  No need to adjust length field, since\n\t  it has been removed.\n\t  (buffer_putw,buffer_flush,buffer_flush_vty_all,buffer_flush_vty)\n\t  Remove unused functions.\n\t  (buffer_flush_all) Rewrite using buffer_flush_available to eliminate\n\t  a possible failure mode if IOV_MAX is less than the number of buffers\n\t  on the queue.\n\t  (buffer_flush_window) Incorporate logic from buffer_flush_vty.\n\t  Log an error message if there is a writev error.\n\t  (buffer_flush_available) Be more paranoid: check for case where\n\t  buffer is already empty.  Use new ERRNO_IO_RETRY macro, and use\n\t  new enum for return codes.  Simplify deletion logic (since it\u0027s\n\t  now a singly-linked list).\n\t  (buffer_write) New function for use with non-blocking I/O.\n\t* vty.h: Replace the struct vty sb_buffer field with a fixed-size\n\t  (5-character) sb_buf field and an sb_len field, since using\n\t  a struct buffer was inappropriate for this task.  Add some useful\n\t  comments about telnet window size negotiation.\n\t* vty.c: Include \u003carpa/telnet.h\u003e (no longer included by zebra.h).\n\t  Remove VTY_OBUF_SIZE (instead use buffer_new default size).\n\t  Make telnet_backward_char and telnet_space_char static const.\n\t  (vty_out) Replace buffer_write with buffer_put.\n\t  (vty_log_out) Check for I/O errors.  If fatal, close the vty session.\n\t  Consolidate 3 separate writes into a single write call.\n\t  (vty_will_echo,vty_command,vty_next_line,vty_previous_line,\n\t  vty_end_config,vty_describe_fold,vty_clear_buf,vty_serv_sock_addrinfo,\n\t  vty_serv_sock_family,vty_serv_un,vty_use_backup_config,exec_timeout,\n\t  vty_config_write,vty_save_cwd) Fix scope to static.\n\t  (vty_new) Let buffer_new use its default buffer size.\n\t  (vty_write) Fix signature: 2nd arg should be const char *.\n\t  Replaced buffer_write with buffer_put.\n\t  (vty_telnet_option) Fix minor bug (window height or width greater than\n\t  255 was broken).  Use sb_buf and sb_len instead of removed sb_buffer\n\t  (which was being used improperly).\n\t  (vty_read) On error, use ERRNO_IO_RETRY to decide whether it\u0027s fatal.\n\t  If the error is fatal, call buffer_reset so vty_close does not attempt\n\t  to flush the data.  Use new sb_buf and sb_len instead of sb_buffer\n\t  to store the SB negotiation string.\n\t  (vty_flush) When vty-\u003elines is 0, call buffer_flush_available instead\n\t  of buffer_flush_window.  Look at the return code from buffer_flush\n\t  to detect I/O errors (and in that case, log an error message and\n\t  close the vty).\n\t  (vty_create) Fix scope to static.  Initialize sb_len to 0 instead\n\t  of creating sb_buffer.\n\t  (vty_accept) Set socket nonblocking.\n\t  (vtysh_accept) Use new set_nonblocking function instead of calling\n\t  fcntl directly.\n\t  (vtysh_flush) New function called from vtysh_read (after command\n\t  execution) and from vtysh_write.  This flushes the buffer\n\t  and reacts appropriately to the return code (by closing the vty\n\t  or scheduling further flushes).\n\t  (vtysh_read) Check whether error is fatal using ERRNO_IO_RETRY.\n\t  If not, just try again later.  Otherwise, call buffer_reset before\n\t  calling vty_close (to avoid trying to flush the buffer in vty_close).\n\t  Fix logic to allow case where a command does not arrive atomically\n\t  in a single read call by checking for the terminating NUL char.\n\t  (vtysh_write) Use new vtysh_flush helper function.\n\t  (vty_close) No need to call buffer_empty, just call buffer_flush_all\n\t  in any case (it will check whether the buffer is empty).\n\t  Do not free sb_buffer (since it has been removed).\n\t  (vty_log_fixed) Use writev instead of write.\n\t* zebra.h: Do not include \u003carpa/telnet.h\u003e, since this is used only\n\t  by lib/vty.c.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d1a229eda7a78ddf83959c2b159f8539e23caf8",
      "old_mode": 33188,
      "old_path": "lib/ChangeLog",
      "new_id": "af3841a5e00f52863ea141bb224ccb8d66e0890c",
      "new_mode": 33188,
      "new_path": "lib/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "8666ab78d1b23d6ca51bff383fa929bf52cb41b6",
      "old_mode": 33188,
      "old_path": "lib/buffer.c",
      "new_id": "48fd35af697f05f60f1cf65a9beca8bb98a4234a",
      "new_mode": 33188,
      "new_path": "lib/buffer.c"
    },
    {
      "type": "modify",
      "old_id": "c0245a7f60d2e722c5811ac6955898a9941b060d",
      "old_mode": 33188,
      "old_path": "lib/buffer.h",
      "new_id": "249354cbaae20ccb34de09799707cc41c81832ce",
      "new_mode": 33188,
      "new_path": "lib/buffer.h"
    },
    {
      "type": "modify",
      "old_id": "053e9ee84a948db58ef75856f1fda1cbc2bd7a39",
      "old_mode": 33188,
      "old_path": "lib/vty.c",
      "new_id": "887e3baad282d95f5ee794175acf757182c29053",
      "new_mode": 33188,
      "new_path": "lib/vty.c"
    },
    {
      "type": "modify",
      "old_id": "8cd2b4e31323378580356bc4f905e9a6cc40aaa0",
      "old_mode": 33188,
      "old_path": "lib/vty.h",
      "new_id": "0290a83640bcd02cab1339a83c2124b6a5f38dd1",
      "new_mode": 33188,
      "new_path": "lib/vty.h"
    },
    {
      "type": "modify",
      "old_id": "b952ee4f69ec8eaa0a061db0d5bce16a3db966c2",
      "old_mode": 33188,
      "old_path": "lib/zebra.h",
      "new_id": "ac236e5d632b453a374e68cfbd90c504190954d5",
      "new_mode": 33188,
      "new_path": "lib/zebra.h"
    }
  ]
}
