david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Tidy up debug messages

This commit is contained in:
Michael Brown 2007-01-31 03:05:49 +00:00
parent e38e516463
commit 138967dd6b
1 changed files with 24 additions and 9 deletions

View File

@ -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 )