Method code for $smtp.get_response()

[Turn off line numbering]
  1: arg c;
  2: var line, code, m, more, out;
  3: 
  4: if (c.is_reading_block())
  5:     throw(~engaged, "Connection is already reading.");
  6: more = 1;
  7: out = [];
  8: while (more) {
  9:     line = c.start_reading_block('one);
 10:     if (line == 'disconnected)
 11:         throw(~aborted, "Connection read aborted.");
 12:     line = line[1];
 13:     if (line == 'aborted)
 14:         throw(~aborted, "Connection read aborted.");
 15:     m = regexp(line, "^([0-9]+)([- ])(.*)$");
 16:     if (listlen(m) != 3)
 17:         throw(~invalid, "Unexpected response from server: " + line);
 18:     more = m[2] == "-";
 19:     out += [[toint(m[1]), m[3]]];
 20: }
 21: return out;

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

Tlon