[BACK]Return to buffer.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/Attic/buffer.c between version 1.21.4.2 and 1.22

version 1.21.4.2, 2005/06/05 02:22:39 version 1.22, 2004/10/29 23:56:17
Line 78 
Line 78 
         u_int newlen;          u_int newlen;
         void *p;          void *p;
   
         if (len > BUFFER_MAX_CHUNK)          if (len > 0x100000)
                 fatal("buffer_append_space: len %u not supported", len);                  fatal("buffer_append_space: len %u not supported", len);
   
         /* If the buffer is empty, start using it from the beginning. */          /* If the buffer is empty, start using it from the beginning. */
Line 97 
Line 97 
          * If the buffer is quite empty, but all data is at the end, move the           * If the buffer is quite empty, but all data is at the end, move the
          * data to the beginning and retry.           * data to the beginning and retry.
          */           */
         if (buffer->offset > MIN(buffer->alloc, BUFFER_MAX_CHUNK)) {          if (buffer->offset > buffer->alloc / 2) {
                 memmove(buffer->buf, buffer->buf + buffer->offset,                  memmove(buffer->buf, buffer->buf + buffer->offset,
                         buffer->end - buffer->offset);                          buffer->end - buffer->offset);
                 buffer->end -= buffer->offset;                  buffer->end -= buffer->offset;
Line 107 
Line 107 
         /* Increase the size of the buffer and retry. */          /* Increase the size of the buffer and retry. */
   
         newlen = buffer->alloc + len + 32768;          newlen = buffer->alloc + len + 32768;
         if (newlen > BUFFER_MAX_LEN)          if (newlen > 0xa00000)
                 fatal("buffer_append_space: alloc %u not supported",                  fatal("buffer_append_space: alloc %u not supported",
                     newlen);                      newlen);
         buffer->buf = xrealloc(buffer->buf, newlen);          buffer->buf = xrealloc(buffer->buf, newlen);

Legend:
Removed from v.1.21.4.2  
changed lines
  Added in v.1.22