Fixed dcb_write failing when the cause was EAGAIN or EWOULDBLOCK.

This commit is contained in:
Markus Makela
2015-07-22 15:34:51 +03:00
parent 19d9c9982f
commit 7363343499
2 changed files with 18 additions and 7 deletions

View File

@ -2493,8 +2493,8 @@ static bool route_single_stmt(
rses_end_locked_router_action(rses);
goto retblock;
}
if ((ret = target_dcb->func.write(target_dcb, gwbuf_clone(querybuf))) == 1)
GWBUF* wbuf = gwbuf_clone(querybuf);
if ((ret = target_dcb->func.write(target_dcb, wbuf)) == 1)
{
backend_ref_t* bref;
@ -2508,7 +2508,8 @@ static bool route_single_stmt(
}
else
{
LOGIF(LE, (skygw_log_write_flush(
gwbuf_free(wbuf);
LOGIF((LE|LT), (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Routing query failed.")));
succp = false;