[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.57.2.3 and 1.58

version 1.57.2.3, 2006/11/08 00:44:05 version 1.58, 2006/01/02 01:20:31
Line 1 
Line 1 
 /* $OpenBSD$ */  
 /*  /*
  * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>   * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
  *   *
Line 20 
Line 19 
 /* 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 <sys/types.h>  #include "includes.h"
   RCSID("$OpenBSD$");
   
 #include <sys/queue.h>  #include <sys/queue.h>
 #include <sys/stat.h>  
 #include <sys/time.h>  
 #include <sys/param.h>  
 #include <sys/uio.h>  
   
 #include <errno.h>  
 #include <fcntl.h>  
 #include <signal.h>  
 #include <stdio.h>  
 #include <string.h>  
 #include <unistd.h>  
 #include <stdarg.h>  
   
 #include "xmalloc.h"  
 #include "buffer.h"  #include "buffer.h"
   #include "bufaux.h"
   #include "getput.h"
   #include "xmalloc.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 49 
Line 39 
 extern volatile sig_atomic_t interrupted;  extern volatile sig_atomic_t interrupted;
 extern int showprogress;  extern int showprogress;
   
 /* Minimum amount of data to read at a time */  /* Minimum amount of data to read at at time */
 #define MIN_READ_SIZE   512  #define MIN_READ_SIZE   512
   
 struct sftp_conn {  struct sftp_conn {
Line 65 
Line 55 
 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_u32(mlen, buffer_len(m));          PUT_32BIT(mlen, buffer_len(m));
         iov[0].iov_base = mlen;          if (atomicio(vwrite, fd, mlen, sizeof(mlen)) != sizeof(mlen))
         iov[0].iov_len = sizeof(mlen);                  fatal("Couldn't send packet: %s", strerror(errno));
         iov[1].iov_base = buffer_ptr(m);  
         iov[1].iov_len = buffer_len(m);  
   
         if (atomiciov(writev, fd, iov, 2) != buffer_len(m) + sizeof(mlen))          if (atomicio(vwrite, fd, buffer_ptr(m), buffer_len(m)) != buffer_len(m))
                 fatal("Couldn't send packet: %s", strerror(errno));                  fatal("Couldn't send packet: %s", strerror(errno));
   
         buffer_clear(m);          buffer_clear(m);
Line 401 
Line 388 
                                 printf("%s\n", longname);                                  printf("%s\n", longname);
   
                         if (dir) {                          if (dir) {
                                 *dir = xrealloc(*dir, ents + 2, sizeof(**dir));                                  *dir = xrealloc(*dir, 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 1124 
Line 1112 
                         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.57.2.3  
changed lines
  Added in v.1.58