| 101 | |
| 102 | |
| 103 | void HttpProxy::waited(const Future<Response>& future) |
| 104 | { |
| 105 | CHECK(items.size() > 0); |
| 106 | Item* item = items.front(); |
| 107 | |
| 108 | CHECK(future == item->future); |
| 109 | |
| 110 | // Process the item and determine if we're done or not (so we know |
| 111 | // whether to start waiting on the next responses). |
| 112 | bool processed = process(item->future, item->request); |
| 113 | |
| 114 | items.pop(); |
| 115 | delete item; |
| 116 | |
| 117 | if (processed) { |
| 118 | next(); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | |
| 123 | bool HttpProxy::process(const Future<Response>& future, const Request& request) |