mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-16 00:01:34 +00:00
Tidy up debug messages
This commit is contained in:
parent
e38e516463
commit
138967dd6b
@ -45,6 +45,24 @@ void stream_associate ( struct stream_application *app,
|
||||
app->conn = conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disassociate application from connection
|
||||
*
|
||||
* @v app Stream application
|
||||
* @v conn Stream connection
|
||||
*/
|
||||
static void stream_disassociate ( struct stream_application *app,
|
||||
struct stream_connection *conn ) {
|
||||
|
||||
DBGC ( app, "Stream %p disassociating from connection %p\n",
|
||||
app, conn );
|
||||
|
||||
assert ( conn->app == app );
|
||||
assert ( app->conn == conn );
|
||||
conn->app = NULL;
|
||||
app->conn = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connection established
|
||||
*
|
||||
@ -76,18 +94,16 @@ void stream_connected ( struct stream_connection *conn ) {
|
||||
void stream_closed ( struct stream_connection *conn, int rc ) {
|
||||
struct stream_application *app = conn->app;
|
||||
|
||||
DBGC ( app, "Stream %p closed (%s)\n", app, strerror ( rc ) );
|
||||
|
||||
/* Check connection actually exists */
|
||||
if ( ! app ) {
|
||||
DBGC ( conn, "Stream connection %p has no application\n",
|
||||
conn );
|
||||
/* Not an error; don't display a debug message */
|
||||
return;
|
||||
}
|
||||
|
||||
DBGC ( app, "Stream %p closed (%s)\n", app, strerror ( rc ) );
|
||||
|
||||
/* Disassociate application from connection */
|
||||
app->conn = NULL;
|
||||
conn->app = NULL;
|
||||
stream_disassociate ( app, conn );
|
||||
|
||||
/* Hand off to application */
|
||||
if ( app->op->closed )
|
||||
@ -244,13 +260,12 @@ void stream_close ( struct stream_application *app ) {
|
||||
|
||||
/* Check connection actually exists */
|
||||
if ( ! conn ) {
|
||||
DBGC ( app, "Stream %p has no connection\n", app );
|
||||
/* Not an error; don't display a debug message */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Disassociate application from connection */
|
||||
app->conn = NULL;
|
||||
conn->app = NULL;
|
||||
stream_disassociate ( app, conn );
|
||||
|
||||
/* Hand off to connection */
|
||||
if ( ! conn->op->close )
|
||||
|
Loading…
Reference in New Issue
Block a user