2 * User FTP Server, Share folders over FTP without being root.
3 * Copyright (C) 2008 Isaac Jurado
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option) any later
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 * Send a reply to the client over the control connection. Not a complex
25 * function at all, but necessary almost everywhere else.
27 void reply (const char *str
, int len
)
31 debug("Reply : %.*s", len
- 2, str
);
34 b
= send(SS
.control_sk
, str
, len
, 0);
36 fatal("Control channel output");
45 * Send reply over the current data connection. It succeeds (return value 0)
46 * when all data has been transferred. It fails otherwise (return value -1),
47 * that is, either by an incomplete transfer or a system error.
49 int data_reply (const char *data
, int len
)
55 b
= send(SS
.data_sk
, &data
[l
], len
- l
, 0);
58 error("Sending listing data");