summaryrefslogtreecommitdiff
path: root/apps/system/zmodem/zm_receive.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-07-14 17:01:23 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-07-14 17:01:23 -0600
commita9ac8ee92de976a5450e3a060a561e22094f4d60 (patch)
tree8b1201d325c23a980f2f67617dfdf8b502f99932 /apps/system/zmodem/zm_receive.c
parentebc9e1858b5c0d534cbd9fe0e52ceeebecabe241 (diff)
downloadnuttx-a9ac8ee92de976a5450e3a060a561e22094f4d60.tar.gz
nuttx-a9ac8ee92de976a5450e3a060a561e22094f4d60.tar.bz2
nuttx-a9ac8ee92de976a5450e3a060a561e22094f4d60.zip
Fix some Zmodem buffer sizing issues
Diffstat (limited to 'apps/system/zmodem/zm_receive.c')
-rw-r--r--apps/system/zmodem/zm_receive.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/system/zmodem/zm_receive.c b/apps/system/zmodem/zm_receive.c
index c26d15e02..e172b5740 100644
--- a/apps/system/zmodem/zm_receive.c
+++ b/apps/system/zmodem/zm_receive.c
@@ -324,8 +324,8 @@ static int zmr_zrinit(FAR struct zm_state_s *pzm)
/* Send ZRINIT */
pzm->timeout = CONFIG_SYSTEM_ZMODEM_RESPTIME;
- buf[0] = CONFIG_SYSTEM_ZMODEM_RCVBUFSIZE & 0xff;
- buf[1] = (CONFIG_SYSTEM_ZMODEM_RCVBUFSIZE >> 8) & 0xff;
+ buf[0] = CONFIG_SYSTEM_ZMODEM_PKTBUFSIZE & 0xff;
+ buf[1] = (CONFIG_SYSTEM_ZMODEM_PKTBUFSIZE >> 8) & 0xff;
buf[2] = 0;
buf[3] = pzmr->rcaps;
return zm_sendhexhdr(pzm, ZRINIT, buf);
@@ -739,11 +739,13 @@ static int zmr_filedata(FAR struct zm_state_s *pzm)
zmdbg("PSTATE %d:%d->%d:%d\n",
pzm->pstate, pzm->psubstate, PSTATE_DATA, PDATA_READ);
- /* Revert to the IDLE state and send the cancel string */
+ /* Send the cancel string */
- pzm->pstate = PSTATE_DATA;
- pzm->psubstate = PDATA_READ;
(void)zm_remwrite(pzm->remfd, g_canistr, CANISTR_SIZE);
+
+ /* Enter PSTATE_DATA */
+
+ zm_readstate(pzm);
return -EIO;
}
else