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

Diff for /src/usr.bin/ssh/msg.c between version 1.8 and 1.8.2.1

version 1.8, 2005/05/24 17:32:43 version 1.8.2.1, 2006/10/06 03:19:32
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.   * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *   *
Line 21 
Line 22 
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
 #include "includes.h"  
 RCSID("$OpenBSD$");  
   
   #include <sys/types.h>
   #include <sys/uio.h>
   
   #include <errno.h>
   #include <stdio.h>
   #include <string.h>
   #include <unistd.h>
   #include <stdarg.h>
   
 #include "buffer.h"  #include "buffer.h"
 #include "getput.h"  
 #include "log.h"  #include "log.h"
 #include "atomicio.h"  #include "atomicio.h"
 #include "msg.h"  #include "msg.h"
   #include "misc.h"
   
 int  int
 ssh_msg_send(int fd, u_char type, Buffer *m)  ssh_msg_send(int fd, u_char type, Buffer *m)
Line 38 
Line 46 
   
         debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff);          debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff);
   
         PUT_32BIT(buf, mlen + 1);          put_u32(buf, mlen + 1);
         buf[4] = type;          /* 1st byte of payload is mesg-type */          buf[4] = type;          /* 1st byte of payload is mesg-type */
         if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {          if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
                 error("ssh_msg_send: write");                  error("ssh_msg_send: write");
Line 64 
Line 72 
                         error("ssh_msg_recv: read: header");                          error("ssh_msg_recv: read: header");
                 return (-1);                  return (-1);
         }          }
         msg_len = GET_32BIT(buf);          msg_len = get_u32(buf);
         if (msg_len > 256 * 1024) {          if (msg_len > 256 * 1024) {
                 error("ssh_msg_recv: read: bad msg_len %u", msg_len);                  error("ssh_msg_recv: read: bad msg_len %u", msg_len);
                 return (-1);                  return (-1);

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.8.2.1