MINOR: sconn: Set SE_FL_ERROR only when there is no more data to read
SE_FL_ERR_PENDING flag is used when there is still data to be read. So we must take care to not set SE_FL_ERROR too early. Thus, on sending path, it must be set if SE_FL_EOS was already set.
This commit is contained in:
parent
ab79b321d6
commit
7f6aa56d47
|
@ -792,7 +792,7 @@ static void sc_app_chk_snd_conn(struct stconn *sc)
|
|||
|
||||
if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING) || sc_is_conn_error(sc)) {
|
||||
/* Write error on the file descriptor */
|
||||
if (sc->state >= SC_ST_CON)
|
||||
if (sc->state >= SC_ST_CON && sc_ep_test(sc, SE_FL_EOS))
|
||||
sc_ep_set(sc, SE_FL_ERROR);
|
||||
goto out_wakeup;
|
||||
}
|
||||
|
@ -1650,7 +1650,8 @@ static int sc_conn_send(struct stconn *sc)
|
|||
*/
|
||||
if (sc->state < SC_ST_CON)
|
||||
return 0;
|
||||
sc_ep_set(sc, SE_FL_ERROR);
|
||||
if (sc_ep_test(sc, SE_FL_EOS))
|
||||
sc_ep_set(sc, SE_FL_ERROR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1764,7 +1765,8 @@ static int sc_conn_send(struct stconn *sc)
|
|||
}
|
||||
|
||||
if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING)) {
|
||||
sc_ep_set(sc, SE_FL_ERROR);
|
||||
if (sc_ep_test(sc, SE_FL_EOS))
|
||||
sc_ep_set(sc, SE_FL_ERROR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue