If write buffering is enabled, then it is necessary to release the write buffer resources (callback structure) when the socket is closed
This commit is contained in:
parent
10d4657d15
commit
d89adb76d8
@ -215,7 +215,7 @@ static void telnetd_getchar(FAR struct telnetd_dev_s *priv, uint8_t ch,
|
|||||||
* Name: telnetd_receive
|
* Name: telnetd_receive
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Process a received telenet buffer
|
* Process a received Telnet buffer
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -500,12 +500,20 @@ static int telnetd_close(FAR struct file *filep)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Unregister the character driver */
|
/* Un-register the character driver */
|
||||||
|
|
||||||
ret = unregister_driver(devpath);
|
ret = unregister_driver(devpath);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nlldbg("Failed to unregister the driver %s: %d\n", devpath, ret);
|
/* NOTE: a return value of -EBUSY is not an error, it simply
|
||||||
|
* means that the Telnet driver is busy now and cannot be
|
||||||
|
* registered now because there are other sessions using the
|
||||||
|
* connection. The driver will be properly unregistered when
|
||||||
|
* the final session terminates.
|
||||||
|
*/
|
||||||
|
|
||||||
|
nlldbg("Failed to unregister the driver %s: %d\n",
|
||||||
|
devpath, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(devpath);
|
free(devpath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user