HttpConnection(const char *serverName, const char *path, bool blocking=false) { this->serverName = serverName; this->path = path; alloc = 64; data = (char*)calloc(alloc, 1); len = 0; finished = success = false; error = ""; if(blocking) httpGet(this); else htThreadCreate(httpGet, this, 0); }
// Nicer threading interface around the other functions: inline HThreadID Create(HThreadFunc func, void *data, int joinable = 1) { return htThreadCreate(func, data, joinable); }