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