File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ bool NetworkProtocolFS::open_file()
5858
5959 if (aux1_open == 4 || aux1_open == 8 )
6060 resolve ();
61+ else
62+ stat ();
6163
6264 update_dir_filename (opened_url);
6365
@@ -182,6 +184,8 @@ bool NetworkProtocolFS::read(unsigned short len)
182184{
183185 bool ret;
184186
187+ is_write = false ;
188+
185189 switch (openMode)
186190 {
187191 case FILE:
@@ -245,6 +249,7 @@ bool NetworkProtocolFS::read_dir(unsigned short len)
245249
246250bool NetworkProtocolFS::write (unsigned short len)
247251{
252+ is_write = true ;
248253 len = translate_transmit_buffer ();
249254 return write_file (len); // Do more here? not sure.
250255}
@@ -285,7 +290,10 @@ bool NetworkProtocolFS::status_file(NetworkStatus *status)
285290#endif
286291
287292 status->connected = fileSize > 0 ? 1 : 0 ;
288- status->error = fileSize > 0 ? error : NETWORK_ERROR_END_OF_FILE;
293+ if (is_write)
294+ status->error = 1 ;
295+ else
296+ status->error = fileSize > 0 ? error : NETWORK_ERROR_END_OF_FILE;
289297
290298 NetworkProtocol::status (status);
291299
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ bool NetworkProtocol::write(unsigned short len)
181181 */
182182bool NetworkProtocol::status (NetworkStatus *status)
183183{
184- if (receiveBuffer->length () == 0 && status->rxBytesWaiting > 0 )
184+ if (!is_write && receiveBuffer->length () == 0 && status->rxBytesWaiting > 0 )
185185 read (status->rxBytesWaiting );
186186
187187 status->rxBytesWaiting = receiveBuffer->length ();
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ class NetworkProtocol
1111{
1212public:
1313 std::string name = " UNKNOWN" ;
14-
14+ /* *
15+ * Was the last command a write?
16+ */
17+ bool is_write = false ;
18+
1519 /* *
1620 * Pointer to the receive buffer
1721 */
You can’t perform that action at this time.
0 commit comments