Roxen.git / server / plugins / protocols / ftp.pike

version» Context lines:

Roxen.git/server/plugins/protocols/ftp.pike:1:   // This is a roxen protocol module.   // Copyright © 1997 - 2001, Roxen IS.      /*    * FTP protocol mk 2    * -  * $Id: ftp.pike,v 2.85 2002/11/10 01:48:25 mani Exp $ +  * $Id: ftp.pike,v 2.86 2003/01/07 18:34:07 jhs Exp $    *    * Henrik Grubbström <grubba@roxen.com>    */      /*    * TODO:    *    * How much is supposed to be logged?    */   
Roxen.git/server/plugins/protocols/ftp.pike:942:    }    if (name_directories) {    listing = "\n" + short + ":\n" + listing;    }    if (listing != "") {    output(listing);    }    session = RequestID2(master_session);    session->method = "LIST";    session->not_query = long; +  session->conf->sent = sizeof(listing);    session->conf->log(([ "error":200, "len":sizeof(listing) ]), session);    }    if (!dir_stack->ptr) {    output(0); // End marker.    } else {    name_directories = 1;    }    }       void set_blocking()
Roxen.git/server/plugins/protocols/ftp.pike:1050:       if (n_files) {    if (n_files < sizeof(files)) {    files -= ({ 0 });    }    string s = list_files(files, cwd); // May modify dir_stack (-R)    output(s);    RequestID session = RequestID2(master_session);    session->not_query = Array.map(files, fix_path) * " ";    session->method = "LIST"; +  session->conf->sent = sizeof(s);    session->conf->log(([ "error":200, "len":sizeof(s) ]), session);    }    if (dir_stack->ptr) {    name_directories = dir_stack->ptr &&    ((dir_stack->ptr > 1) || n_files);       list_next_directory();    } else {    output(0);    }
Roxen.git/server/plugins/protocols/ftp.pike:1821:    "local error in processing.", cmd) }));    break;    default:    if (!file) {    file = ([ "error":404 ]);    }    send(550, ({ sprintf("'%s': %s: No such file or directory.",    cmd, f) }));    break;    } +  session->conf->sent = file->len;    session->conf->log(file, session);    }       static private int open_file(string fname, object session, string cmd)    {    object|array|mapping file;       file = stat_file(fname, session);       if (objectp(file) || arrayp(file)) {
Roxen.git/server/plugins/protocols/ftp.pike:2025:    case 413:    send(550, ({ sprintf("%s: Quota exceeded.", args) }));    break;    case 501:    send(502, ({ sprintf("%s: Command not implemented.", args) }));    break;    default:    send(550, ({ sprintf("%s: Error opening file.", args) }));    break;    } +  session->conf->sent = session->file->len;    session->conf->log(session->file, session);    return;    }    master_session->file = session->file;    } else {    // Error message has already been sent.    if (fd) {    BACKEND_CLOSE(fd);    }    }
Roxen.git/server/plugins/protocols/ftp.pike:2764:       object session = RequestID2(master_session);    session->method = "CWD";    session->not_query = ncwd;       array|object st = conf->stat_file(ncwd, session);    ncwd = session->not_query; // Makes internal redirects to work.    if (!st) {    send(550, ({ sprintf("%s: No such file or directory, or access denied.",    ncwd) })); +  session->conf->sent = session->file && session->file->len;    session->conf->log(session->file || ([ "error":404 ]), session);    return;    }       if (!(< -2, -3 >)[st[1]]) {    send(504, ({ sprintf("%s: Not a directory.", ncwd) }));    session->conf->log(([ "error":400 ]), session);    return;    }   
Roxen.git/server/plugins/protocols/ftp.pike:2810:    string message;    catch {    message = conf->try_get_file(cwd + ".message", session);    };    if (message) {    reply = (message/"\n")+({ "" })+reply;    }       session->method = "CWD"; // Restore it again.    send(250, reply); -  session->conf->log(([ "error":200, "len":sizeof(reply*"\n") ]), session); +  session->conf->sent = sizeof(reply * "\n"); +  session->conf->log(([ "error":200, "len":session->conf->sent ]), session);    }       void ftp_XCWD(string args)    {    ftp_CWD(args);    }       void ftp_CDUP(string args)    {    ftp_CWD("../");