* ���ص��麯�����ûص��������������� aio_istream ʵ���е� * gets/read �Ŀɶ��������ã����첽����ڲ��������������� * �ݶ�����ֱ�Ӵ��ݸ��û������� * @param data {char*} ���������ݵ�ָ���ַ * @param len {int} ���������ݳ���(> 0) * @return {bool} �ú������� false ֪ͨ�첽����رո��첽�� */
| 121 | * @return {bool} �ú������� false ֪ͨ�첽����رո��첽�� |
| 122 | */ |
| 123 | bool read_wakeup(void) |
| 124 | { |
| 125 | acl::polarssl_io* hook = (acl::polarssl_io*) client_->get_hook(); |
| 126 | if (hook == NULL) { |
| 127 | // �� SSL ģʽ���첽��ȡһ������ |
| 128 | client_->gets(__timeout, false); |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | // ���Խ��� SSL ���� |
| 133 | if (!hook->handshake()) { |
| 134 | printf("ssl handshake failed\r\n"); |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | // ��� SSL �����Ѿ��ɹ�����ʼ���ж����� |
| 139 | if (hook->handshake_ok()) { |
| 140 | // �� reactor ģʽתΪ proactor ģʽ���Ӷ�ȡ�� |
| 141 | // read_wakeup �ص����� |
| 142 | client_->disable_read(); |
| 143 | |
| 144 | // �첽��ȡһ�� |
| 145 | client_->gets(__timeout, false); |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | // SSL ���ֻ�δ��ɣ��ȴ��������ٴα����� |
| 150 | return true; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * ʵ�ָ����е��麯�����ͻ������Ķ��ɹ��ص����� |
nothing calls this directly
no test coverage detected