| 213 | }; |
| 214 | |
| 215 | void |
| 216 | generateRequests(const Origins &o, const TSMBuffer buffer, const TSMLoc location, Requests &r) |
| 217 | { |
| 218 | assert(!o.empty()); |
| 219 | assert(buffer != nullptr); |
| 220 | assert(location != nullptr); |
| 221 | |
| 222 | Origins::const_iterator iterator = o.begin(); |
| 223 | const Origins::const_iterator end = o.end(); |
| 224 | |
| 225 | OriginalRequest request(buffer, location); |
| 226 | request.urlScheme(""); |
| 227 | request.urlHost(""); |
| 228 | request.xMultiplexerHeader("copy"); |
| 229 | |
| 230 | for (; iterator != end; ++iterator) { |
| 231 | const std::string &host = *iterator; |
| 232 | assert(!host.empty()); |
| 233 | request.hostHeader(host); |
| 234 | Dbg(dbg_ctl, "Preparing request for \"%s\"", host.c_str()); |
| 235 | r.push_back(Request(host, buffer, location)); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | void |
| 240 | addBody(Requests &r, const TSIOBufferReader re) |