| 269 | } |
| 270 | |
| 271 | void http::onLoaded(const char* file) { |
| 272 | if (strstr(file,"prepare")) { |
| 273 | FILE* f = fopen(file,"rb"); |
| 274 | if (f) { |
| 275 | fseek (f, 0, SEEK_END); |
| 276 | int size=ftell (f); |
| 277 | fseek (f, 0, SEEK_SET); |
| 278 | |
| 279 | char* data = new char[size]; |
| 280 | fread(data,size,1,f); |
| 281 | _content = data; |
| 282 | delete[] data; |
| 283 | fclose(f); |
| 284 | } else { |
| 285 | _content = file; |
| 286 | } |
| 287 | } else { |
| 288 | _content = file; |
| 289 | } |
| 290 | |
| 291 | _progressValue = 100; |
| 292 | _status = ST_OK; |
| 293 | } |
| 294 | |
| 295 | void http::onError(int error) { |
| 296 | printf("onError status: %d\n",error); |