Method code for $smtp.get_response()

[Turn on line numbering]
arg c;
var line, code, m, more, out;

if (c.is_reading_block())
    throw(~engaged, "Connection is already reading.");
more = 1;
out = [];
while (more) {
    line = c.start_reading_block('one);
    if (line == 'disconnected)
        throw(~aborted, "Connection read aborted.");
    line = line[1];
    if (line == 'aborted)
        throw(~aborted, "Connection read aborted.");
    m = regexp(line, "^([0-9]+)([- ])(.*)$");
    if (listlen(m) != 3)
        throw(~invalid, "Unexpected response from server: " + line);
    more = m[2] == "-";
    out += [[toint(m[1]), m[3]]];
}
return out;

// Created 13-Oct-1996 as a part of ColdCore, see: @help Credit

Tlon