agoo_server_bind(agooBind b) {
    // If a bind with the same port already exists, replace it.
    agooBind	prev = NULL;
    agooBind    bx   = NULL;

    if (NULL == b->read) {
	b->read = agoo_con_http_read;
    }
    if (NULL == b->write) {
	b->write = agoo_con_http_write;
    }
    if (NULL == b->events) {
	b->events = agoo_con_http_events;
    }
    for (bx = agoo_server.binds; NULL != bx; bx = bx->next) {
	if (bx->port == b->port) {
	    b->next = bx->next;
	    if (NULL == prev) {
		agoo_server.binds = b;
	    } else {
		prev->next = b;
	    }
	    agoo_bind_destroy(bx);
	    return;
	}
	prev = bx;
    }
    b->next = agoo_server.binds;
    agoo_server.binds = b;
}
agoo_server_bind(agooBind b) {
     
    agooBind	prev = NULL;
    agooBind    bx   = NULL;

    if (NULL == b->read) {
	b->read = agoo_con_http_read;
    }
    if (NULL == b->write) {
	b->write = agoo_con_http_write;
    }
    if (NULL == b->events) {
	b->events = agoo_con_http_events;
    }
    for (bx = agoo_server.binds; NULL != bx; bx = bx->next) {
	if (bx->port == b->port) {
	    b->next = bx->next;
	    if (NULL == prev) {
		agoo_server.binds = b;
	    } else {
		prev->next = b;
	    }
	    agoo_bind_destroy(bx);
	    return;
	}
	prev = bx;
    }
    b->next = agoo_server.binds;
    agoo_server.binds = b;
}