Skip to content

Commit

Permalink
Minor bug fixes. (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
keshonok committed Feb 13, 2017
1 parent 2dc1f91 commit f245c8f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions tempesta_fw/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ tfw_connection_validate_cleanup(TfwConnection *conn)

BUG_ON(!conn);
BUG_ON(!list_empty(&conn->list));
BUG_ON((TFW_CONN_TYPE(conn) & Conn_Clnt)
&& !list_empty(&conn->msg_queue));
BUG_ON(atomic_read(&conn->refcnt) & ~1);
BUG_ON(atomic_read(&conn->refcnt) & ~1); /* FIXME */
BUG_ON(conn->msg);

rc = atomic_read(&conn->refcnt);
Expand Down
1 change: 0 additions & 1 deletion tempesta_fw/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ tfw_http_conn_init(TfwConnection *conn)
conn->forward = tfw_http_req_fwd_repair;
set_bit(TFW_CONN_B_RESEND, &conn->flags);
}
INIT_LIST_HEAD(&conn->nip_queue);
}
tfw_gfsm_state_init(&conn->state, conn, TFW_HTTP_FSM_INIT);
return 0;
Expand Down
2 changes: 2 additions & 0 deletions tempesta_fw/sock_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ tfw_cli_conn_free(TfwConnection *conn)

/* Check that all nested resources are freed. */
tfw_connection_validate_cleanup(conn);
BUG_ON(!list_empty(&conn->msg_queue));

kmem_cache_free(tfw_cli_cache(TFW_CONN_TYPE(conn)), conn);
}

Expand Down
5 changes: 5 additions & 0 deletions tempesta_fw/sock_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ tfw_srv_conn_alloc(void)
return NULL;

tfw_connection_init(&srv_conn->conn);
atomic_set(&srv_conn->conn.msg_qsize, 0);
INIT_LIST_HEAD(&srv_conn->conn.nip_queue);
__setup_retry_timer(srv_conn);
ss_proto_init(&srv_conn->conn.proto,
&tfw_sock_srv_ss_hooks, Conn_HttpSrv);
Expand All @@ -514,6 +516,9 @@ tfw_srv_conn_free(TfwSrvConnection *srv_conn)

/* Check that all nested resources are freed. */
tfw_connection_validate_cleanup(&srv_conn->conn);
BUG_ON(atomic_read(&srv_conn->conn.msg_qsize));
BUG_ON(!list_empty(&srv_conn->conn.nip_queue));

kmem_cache_free(tfw_srv_conn_cache, srv_conn);
}

Expand Down

0 comments on commit f245c8f

Please sign in to comment.