| 115 if(request->connection->ssl) { |
115 if(request->connection->ssl) { |
| 116 io = sslstream_new(pool, request->connection->ssl); |
116 io = sslstream_new(pool, request->connection->ssl); |
| 117 } else { |
117 } else { |
| 118 io = sysstream_new(pool, request->connection->fd); |
118 io = sysstream_new(pool, request->connection->fd); |
| 119 } |
119 } |
| 120 sn->sn.csd = httpstream_new(pool, io); |
120 sn->sn.csd = httpstream_new(pool, io); |
| 121 |
121 |
| 122 |
122 |
| 123 sn->sn.client = pblock_create_pool(sn->sn.pool, 8); |
123 sn->sn.client = pblock_create_pool(sn->sn.pool, 8); |
| 124 sn->sn.next = NULL; |
124 sn->sn.next = NULL; |
| 125 sn->sn.fill = 1; |
125 sn->sn.fill = 1; |
| 296 rq->host = host; |
296 rq->host = host; |
| 297 } else { |
297 } else { |
| 298 rq->host = NULL; // TODO: value from listener |
298 rq->host = NULL; // TODO: value from listener |
| 299 } |
299 } |
| 300 rq->port = request->connection->listener->port; |
300 rq->port = request->connection->listener->port; |
| |
301 |
| |
302 if(rq->host) { |
| |
303 VirtualServer *vs = ucx_map_cstr_get(sn->config->host_vs, rq->host); |
| |
304 if(vs) { |
| |
305 rq->vs = vs; |
| |
306 } else { |
| |
307 log_ereport( |
| |
308 LOG_VERBOSE, |
| |
309 "Unkown host '%s': using default virtual server", |
| |
310 rq->host); |
| |
311 } |
| |
312 } |
| 301 |
313 |
| 302 // parse connection header |
314 // parse connection header |
| 303 rq->rq.rq_attr.keep_alive = (rq->rq.protv_num >= PROTOCOL_VERSION_HTTP11); |
315 rq->rq.rq_attr.keep_alive = (rq->rq.protv_num >= PROTOCOL_VERSION_HTTP11); |
| 304 char *conn_str = pblock_findkeyval(pb_key_connection, rq->rq.headers); |
316 char *conn_str = pblock_findkeyval(pb_key_connection, rq->rq.headers); |
| 305 if(conn_str) { |
317 if(conn_str) { |