| 28 |
static void conn_start_threadstart(void* conn); |
static void conn_start_threadstart(void* conn); |
| 29 |
|
|
| 30 |
void conn_init(conn_t *c, const url_t* url, const axel_t* axel, AXEL_SIZE startbyte, AXEL_SIZE endbyte) { |
void conn_init(conn_t *c, const url_t* url, const axel_t* axel, AXEL_SIZE startbyte, AXEL_SIZE endbyte) { |
| 31 |
c->conf = conf; |
c->axel = axel; |
| 32 |
c->url = url; |
c->url = url; |
| 33 |
|
|
| 34 |
proto_init(c->proto, url->protoid); |
proto_init(c->proto, url->protoid); |
| 37 |
c->cstate = INITIALIZED; |
c->cstate = INITIALIZED; |
| 38 |
} |
} |
| 39 |
|
|
| 40 |
// Start a new thread. |
// Entry point for a created thread |
|
_Bool conn_start(conn_t* c) { |
|
|
if (pthread_create(conn->thread, NULL, conn_threadstart, c) != 0) { |
|
|
axel_message(conn->axel, _("Thread creation failed")); |
|
|
return false; |
|
|
} |
|
|
|
|
|
return true; |
|
|
} |
|
|
|
|
|
// Entry point for the created thread |
|
| 41 |
void conn_threadstart(void* conn_void) { |
void conn_threadstart(void* conn_void) { |
| 42 |
int oldstate; // Dummy |
int oldstate; // Dummy |
| 43 |
|
|