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

Diff for /src/usr.bin/ssh/sftp-client.c between version 1.60 and 1.60.2.2

version 1.60, 2006/02/20 17:19:54 version 1.60.2.2, 2006/11/08 00:17:14
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>   * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *   *
Line 19 
Line 20 
 /* XXX: remove all logging, only return status codes */  /* XXX: remove all logging, only return status codes */
 /* XXX: copy between two remote sites */  /* XXX: copy between two remote sites */
   
 #include "includes.h"  
 RCSID("$OpenBSD$");  
   
 #include <sys/queue.h>  
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/queue.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   #include <sys/time.h>
   #include <sys/param.h>
   #include <sys/uio.h>
   
 #include "buffer.h"  #include <errno.h>
 #include "bufaux.h"  #include <fcntl.h>
 #include "getput.h"  #include <signal.h>
   #include <stdio.h>
   #include <string.h>
   #include <unistd.h>
   #include <stdarg.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
   #include "buffer.h"
 #include "log.h"  #include "log.h"
 #include "atomicio.h"  #include "atomicio.h"
 #include "progressmeter.h"  #include "progressmeter.h"
   #include "misc.h"
   
 #include "sftp.h"  #include "sftp.h"
 #include "sftp-common.h"  #include "sftp-common.h"
Line 57 
Line 65 
 send_msg(int fd, Buffer *m)  send_msg(int fd, Buffer *m)
 {  {
         u_char mlen[4];          u_char mlen[4];
           struct iovec iov[2];
   
         if (buffer_len(m) > SFTP_MAX_MSG_LENGTH)          if (buffer_len(m) > SFTP_MAX_MSG_LENGTH)
                 fatal("Outbound message too long %u", buffer_len(m));                  fatal("Outbound message too long %u", buffer_len(m));
   
         /* Send length first */          /* Send length first */
         PUT_32BIT(mlen, buffer_len(m));          put_u32(mlen, buffer_len(m));
         if (atomicio(vwrite, fd, mlen, sizeof(mlen)) != sizeof(mlen))          iov[0].iov_base = mlen;
                 fatal("Couldn't send packet: %s", strerror(errno));          iov[0].iov_len = sizeof(mlen);
           iov[1].iov_base = buffer_ptr(m);
           iov[1].iov_len = buffer_len(m);
   
         if (atomicio(vwrite, fd, buffer_ptr(m), buffer_len(m)) != buffer_len(m))          if (atomiciov(writev, fd, iov, 2) != buffer_len(m) + sizeof(mlen))
                 fatal("Couldn't send packet: %s", strerror(errno));                  fatal("Couldn't send packet: %s", strerror(errno));
   
         buffer_clear(m);          buffer_clear(m);
Line 390 
Line 401 
                                 printf("%s\n", longname);                                  printf("%s\n", longname);
   
                         if (dir) {                          if (dir) {
                                 *dir = xrealloc(*dir, sizeof(**dir) *                                  *dir = xrealloc(*dir, ents + 2, sizeof(**dir));
                                     (ents + 2));  
                                 (*dir)[ents] = xmalloc(sizeof(***dir));                                  (*dir)[ents] = xmalloc(sizeof(***dir));
                                 (*dir)[ents]->filename = xstrdup(filename);                                  (*dir)[ents]->filename = xstrdup(filename);
                                 (*dir)[ents]->longname = xstrdup(longname);                                  (*dir)[ents]->longname = xstrdup(longname);
Line 1114 
Line 1124 
                         if (status != SSH2_FX_OK) {                          if (status != SSH2_FX_OK) {
                                 error("Couldn't write to remote file \"%s\": %s",                                  error("Couldn't write to remote file \"%s\": %s",
                                     remote_path, fx2txt(status));                                      remote_path, fx2txt(status));
                                   if (showprogress)
                                           stop_progress_meter();
                                 do_close(conn, handle, handle_len);                                  do_close(conn, handle, handle_len);
                                 close(local_fd);                                  close(local_fd);
                                 xfree(data);                                  xfree(data);

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.60.2.2