Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-10-06 6bac54b555d27f1a85c1e4f011a6e7bd9111b0d0
src/backend/utils/dbms/utl_smtp/utl_smtp.cpp
@@ -20,7 +20,6 @@
#include <memory>
using std::string;
using std::vector;
using std::unordered_map;
using std::shared_ptr;
using std::make_shared;
@@ -158,8 +157,8 @@
}
/// @brief Считывает весь многострочный ответ SMTP (xyz- промежуточные строки, xyz<space> — последняя).
static vector<string> read_smtp_replies(int fd, string& rbuf, int timeout_sec) {
    vector<string> lines;
static std::vector<string> read_smtp_replies(int fd, string& rbuf, int timeout_sec) {
    std::vector<string> lines;
    string line;
    if (!recv_line(fd, rbuf, line, timeout_sec)) {
        ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED),
@@ -187,7 +186,7 @@
}
/// @brief Бросает исключение пакета при кодах 4xx/5xx; для 2xx/3xx — ничего не делает.
static void raise_on_error_code(int code, const vector<string>& lines) {
static void raise_on_error_code(int code, const std::vector<string>& lines) {
    if (code >= 400 && code <= 499) {
        string all;
        for (auto& s : lines) { all += s; all += "\n"; }
@@ -202,7 +201,7 @@
}
/// @brief Отправляет SMTP-команду cmd [arg] с CRLF и возвращает все строки ответа (с проверкой кодов).
static vector<string> smtp_command(int fd, string& rbuf, int timeout_sec,
static std::vector<string> smtp_command(int fd, string& rbuf, int timeout_sec,
                                   const string& cmd, const string& arg) {
    string wire = cmd;
    if (!arg.empty()) { wire.push_back(' '); wire += arg; }