| 81 | } |
| 82 | |
| 83 | static bool do_run(acl::socket_stream& conn, acl::sslbase_io*) |
| 84 | { |
| 85 | acl::string* buf =(acl::string*) conn.get_ctx(); |
| 86 | |
| 87 | // ������ģʽ��ȡһ�У��÷���������ʽ���� polarssl_io ��ĵײ� |
| 88 | // IO ���̱��ϵ� |
| 89 | if (!conn.gets_peek(buf, false)) { |
| 90 | if (conn.eof()) { |
| 91 | printf("peek error\n"); |
| 92 | return false; |
| 93 | } else { |
| 94 | return true; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | // ����ģʽ��д���ݣ���Ϊ�����ֲ�δ����Ϊ������ģʽ������д�Ĺ��� |
| 99 | // ���������� |
| 100 | if (conn.write(*buf) == -1) { |
| 101 | logger("write error!"); |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | buf->clear(); |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | bool master_service::thread_on_read(acl::socket_stream* conn) |
| 110 | { |