| 171 | } |
| 172 | |
| 173 | void HTTPRequest::_thread_func(void *p_userdata) { |
| 174 | HTTPRequest *hr = static_cast<HTTPRequest *>(p_userdata); |
| 175 | |
| 176 | Error err = hr->_request(); |
| 177 | |
| 178 | if (err != OK) { |
| 179 | hr->_defer_done(RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); |
| 180 | } else { |
| 181 | while (!hr->thread_request_quit.is_set()) { |
| 182 | bool exit = hr->_update_connection(); |
| 183 | if (exit) { |
| 184 | break; |
| 185 | } |
| 186 | OS::get_singleton()->delay_usec(1); |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | hr->thread_done.set(); |
| 191 | } |
| 192 | |
| 193 | void HTTPRequest::cancel_request() { |
| 194 | timer->stop(); |
nothing calls this directly
no test coverage detected