Skip to content

Commit

Permalink
Fix var names in debug statements. Also, fix TfwSrvConn{} init.
Browse files Browse the repository at this point in the history
  • Loading branch information
keshonok committed Feb 2, 2017
1 parent 0430ab6 commit 430836d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tempesta_fw/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ tfw_http_req_zap_error(struct list_head *equeue)
TfwHttpReq *req, *tmp;

TFW_DBG2("%s: queue is %sempty\n",
__func__, list_empty(err_queue) ? "" : "NOT ");
__func__, list_empty(equeue) ? "" : "NOT ");

list_for_each_entry_safe(req, tmp, equeue, fwd_list) {
list_del_init(&req->fwd_list);
Expand Down Expand Up @@ -559,7 +559,7 @@ tfw_http_req_evict_timeout(TfwSrvConn *srv_conn, TfwServer *srv,
if (unlikely(time_after(jqage, srv->sg->max_jqage))) {
TFW_DBG2("%s: Eviction: req=[%p] overdue=[%dms]\n",
__func__, req,
jiffies_to_msecs(jqage - srv->max_jqage));
jiffies_to_msecs(jqage - srv->sg->max_jqage));
tfw_http_req_move2equeue(srv_conn, req, equeue, 504);
return true;
}
Expand Down Expand Up @@ -767,7 +767,7 @@ tfw_http_req_resend(TfwSrvConn *srv_conn, bool first, struct list_head *equeue)
struct list_head *end, *fwd_queue = &srv_conn->fwd_queue;

TFW_DBG2("%s: conn=[%p] one_msg=[%s]\n",
__func__, srv_conn, one_msg ? "true" : "false");
__func__, srv_conn, first ? "true" : "false");
BUG_ON(!srv_conn->msg_sent);
BUG_ON(list_empty(&((TfwHttpReq *)srv_conn->msg_sent)->fwd_list));

Expand Down Expand Up @@ -876,7 +876,7 @@ tfw_http_req_resched(TfwSrvConn *srv_conn, struct list_head *equeue)
TfwServer *srv = (TfwServer *)srv_conn->peer;
struct list_head *fwd_queue = &srv_conn->fwd_queue;

TFW_DBG2("%s: conn=[%p]\n", __func__, conn);
TFW_DBG2("%s: conn=[%p]\n", __func__, srv_conn);

/* Treat a non-idempotent request if any. */
tfw_http_req_fwd_treatnip(srv_conn, equeue);
Expand Down Expand Up @@ -907,6 +907,8 @@ tfw_http_req_resched(TfwSrvConn *srv_conn, struct list_head *equeue)
* server. When a response comes, that will trigger resending of the
* rest of those unanswered requests (__tfw_http_req_fwd_repair()).
*
* The connection is not scheduled until all requests in it are re-sent.
*
* No need to take a reference on the server connection here as this
* is executed as part of establishing the connection. It definitely
* can't go away.
Expand Down
9 changes: 6 additions & 3 deletions tempesta_fw/sock_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ tfw_sock_srv_connect_try_later(TfwSrvConn *srv_conn)
}
if (srv_conn->recns < ARRAY_SIZE(tfw_srv_tmo_vals)) {
timeout = tfw_srv_tmo_vals[srv_conn->recns];
TFW_DBG_ADDR("Cannot establish connection",
&srv_conn->peer->addr);
if (srv_conn->recns)
TFW_DBG_ADDR("Cannot establish connection",
&srv_conn->peer->addr);
} else {
timeout = tfw_srv_tmo_vals[ARRAY_SIZE(tfw_srv_tmo_vals) - 1];
if (srv_conn->recns == ARRAY_SIZE(tfw_srv_tmo_vals)
Expand Down Expand Up @@ -499,6 +500,8 @@ tfw_srv_conn_alloc(void)
return NULL;

tfw_connection_init((TfwConn *)srv_conn);
memset((char *)srv_conn + sizeof(TfwConn), 0,
sizeof(TfwSrvConn) - sizeof(TfwConn));
INIT_LIST_HEAD(&srv_conn->fwd_queue);
INIT_LIST_HEAD(&srv_conn->nip_queue);
spin_lock_init(&srv_conn->fwd_qlock);
Expand Down Expand Up @@ -879,7 +882,7 @@ tfw_cfgop_begin_srv_group(TfwCfgSpec *cs, TfwCfgEntry *ce)
return -EINVAL;
}

TFW_DBG("begin srv_group: %s\n", sg->name);
TFW_DBG("begin srv_group: %s\n", tfw_cfg_in_sg->name);

tfw_cfg_in_slstsz = 0;
tfw_cfg_in_sched = tfw_cfg_out_sched;
Expand Down

0 comments on commit 430836d

Please sign in to comment.