luohaha/CSpider

Page manipulations

mzer0-yu opened this issue · 3 comments

Linked list is NOT a valuable data structure. I implemented something like vector.
Do ask me if you have any questions.

e.g.

unsigned int queue_id, page_id;
queue_id = new_page_queue(512); /* 512 is the capacity of page queue */
page_id = alloc_page_from_queue(queue_id);

cs_page* ptr_to_page = get_page_ptr(page_id);
set_page(ptr_to_page, PTR, LENGTH); /* PTR points to the content */

I don't think page_queue is useful, because it can't add its capacity. And I can't decide what the capacity should be at the beginning.

And, when I get data using cURL, I can't get whole string once, every time I get a part, and then splice it together.

I solved it.