sftp-client.c (146998) | sftp-client.c (147001) |
---|---|
1/* 2 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 6 unchanged lines hidden (view full) --- 15 */ 16 17/* XXX: memleaks */ 18/* XXX: signed vs unsigned */ 19/* XXX: remove all logging, only return status codes */ 20/* XXX: copy between two remote sites */ 21 22#include "includes.h" | 1/* 2 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 6 unchanged lines hidden (view full) --- 15 */ 16 17/* XXX: memleaks */ 18/* XXX: signed vs unsigned */ 19/* XXX: remove all logging, only return status codes */ 20/* XXX: copy between two remote sites */ 21 22#include "includes.h" |
23RCSID("$OpenBSD: sftp-client.c,v 1.52 2004/11/25 22:22:14 markus Exp $"); | 23RCSID("$OpenBSD: sftp-client.c,v 1.53 2005/03/10 22:01:05 deraadt Exp $"); |
24 25#include "openbsd-compat/sys-queue.h" 26 27#include "buffer.h" 28#include "bufaux.h" 29#include "getput.h" 30#include "xmalloc.h" 31#include "log.h" --- 819 unchanged lines hidden (view full) --- 851 852 buffer_clear(&msg); 853 get_msg(conn->fd_in, &msg); 854 type = buffer_get_char(&msg); 855 id = buffer_get_int(&msg); 856 debug3("Received reply T:%u I:%u R:%d", type, id, max_req); 857 858 /* Find the request in our queue */ | 24 25#include "openbsd-compat/sys-queue.h" 26 27#include "buffer.h" 28#include "bufaux.h" 29#include "getput.h" 30#include "xmalloc.h" 31#include "log.h" --- 819 unchanged lines hidden (view full) --- 851 852 buffer_clear(&msg); 853 get_msg(conn->fd_in, &msg); 854 type = buffer_get_char(&msg); 855 id = buffer_get_int(&msg); 856 debug3("Received reply T:%u I:%u R:%d", type, id, max_req); 857 858 /* Find the request in our queue */ |
859 for(req = TAILQ_FIRST(&requests); | 859 for (req = TAILQ_FIRST(&requests); |
860 req != NULL && req->id != id; 861 req = TAILQ_NEXT(req, tq)) 862 ; 863 if (req == NULL) 864 fatal("Unexpected reply %u", id); 865 866 switch (type) { 867 case SSH2_FXP_STATUS: --- 236 unchanged lines hidden (view full) --- 1104 if (type != SSH2_FXP_STATUS) 1105 fatal("Expected SSH2_FXP_STATUS(%d) packet, " 1106 "got %d", SSH2_FXP_STATUS, type); 1107 1108 status = buffer_get_int(&msg); 1109 debug3("SSH2_FXP_STATUS %d", status); 1110 1111 /* Find the request in our queue */ | 860 req != NULL && req->id != id; 861 req = TAILQ_NEXT(req, tq)) 862 ; 863 if (req == NULL) 864 fatal("Unexpected reply %u", id); 865 866 switch (type) { 867 case SSH2_FXP_STATUS: --- 236 unchanged lines hidden (view full) --- 1104 if (type != SSH2_FXP_STATUS) 1105 fatal("Expected SSH2_FXP_STATUS(%d) packet, " 1106 "got %d", SSH2_FXP_STATUS, type); 1107 1108 status = buffer_get_int(&msg); 1109 debug3("SSH2_FXP_STATUS %d", status); 1110 1111 /* Find the request in our queue */ |
1112 for(ack = TAILQ_FIRST(&acks); | 1112 for (ack = TAILQ_FIRST(&acks); |
1113 ack != NULL && ack->id != r_id; 1114 ack = TAILQ_NEXT(ack, tq)) 1115 ; 1116 if (ack == NULL) 1117 fatal("Can't find request for ID %u", r_id); 1118 TAILQ_REMOVE(&acks, ack, tq); 1119 1120 if (status != SSH2_FX_OK) { --- 38 unchanged lines hidden --- | 1113 ack != NULL && ack->id != r_id; 1114 ack = TAILQ_NEXT(ack, tq)) 1115 ; 1116 if (ack == NULL) 1117 fatal("Can't find request for ID %u", r_id); 1118 TAILQ_REMOVE(&acks, ack, tq); 1119 1120 if (status != SSH2_FX_OK) { --- 38 unchanged lines hidden --- |