| 326 | } |
| 327 | |
| 328 | bool Appsock::response(const std::string& rsp) |
| 329 | { |
| 330 | SigPipeBlocker block_sigpipe; |
| 331 | |
| 332 | // Get the response - we expect "log file deletion disable" |
| 333 | sbuf2settimeout(impl->m_sb, 10 * 1000, 10 * 1000); |
| 334 | char line[256]; |
| 335 | if(sbuf2gets(line, sizeof(line), impl->m_sb) <= 0) { |
| 336 | std::clog << "no response from " << impl->m_dbname << " expected " |
| 337 | << rsp << std::endl; |
| 338 | return false; |
| 339 | } else if(std::strcmp(line, rsp.c_str()) != 0) { |
| 340 | std::clog << "bad response from " << impl->m_dbname << " expected " |
| 341 | << rsp << std::endl; |
| 342 | return false; |
| 343 | } |
| 344 | |
| 345 | return true; |
| 346 | } |
| 347 | |
| 348 | std::string Appsock::read_response() |
| 349 | { |
no outgoing calls
no test coverage detected