summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-19 19:56:22 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-20 10:18:32 -0200
commit963e3a793dcca07a162b1f6bbbd4f1d3f889963b (patch)
tree2e41231a8ad40dd4619ae981b2b4994dad340fd7 /src/lib/ecore_con
parent2666e927a5e0e02ea9c3eda2244e80a16fedc996 (diff)
efl_io_reader/writer: always set 'can_*' to FALSE on errors.
If user tries to read or write and that fails then set 'can_read' or 'can_write' to false, regardless of the error code.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_server_udp_client.c4
-rw-r--r--src/lib/ecore_con/efl_net_socket_fd.c6
-rw-r--r--src/lib/ecore_con/efl_net_socket_udp.c6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/ecore_con/efl_net_server_udp_client.c b/src/lib/ecore_con/efl_net_server_udp_client.c
index 1a4a46ee54..20cec66a7f 100644
--- a/src/lib/ecore_con/efl_net_server_udp_client.c
+++ b/src/lib/ecore_con/efl_net_server_udp_client.c
@@ -170,7 +170,7 @@ _efl_net_server_udp_client_efl_io_reader_read(Eo *o, Efl_Net_Server_Udp_Client_D
170} 170}
171 171
172EOLIAN static Eina_Error 172EOLIAN static Eina_Error
173_efl_net_server_udp_client_efl_io_writer_write(Eo *o EINA_UNUSED, Efl_Net_Server_Udp_Client_Data *pd, Eina_Slice *ro_slice, Eina_Slice *remaining) 173_efl_net_server_udp_client_efl_io_writer_write(Eo *o, Efl_Net_Server_Udp_Client_Data *pd, Eina_Slice *ro_slice, Eina_Slice *remaining)
174{ 174{
175 ssize_t r; 175 ssize_t r;
176 176
@@ -189,6 +189,7 @@ _efl_net_server_udp_client_efl_io_writer_write(Eo *o EINA_UNUSED, Efl_Net_Server
189 if (remaining) *remaining = *ro_slice; 189 if (remaining) *remaining = *ro_slice;
190 ro_slice->len = 0; 190 ro_slice->len = 0;
191 ro_slice->mem = NULL; 191 ro_slice->mem = NULL;
192 efl_io_writer_can_write_set(o, EINA_FALSE);
192 return err; 193 return err;
193 } 194 }
194 } 195 }
@@ -207,6 +208,7 @@ _efl_net_server_udp_client_efl_io_writer_write(Eo *o EINA_UNUSED, Efl_Net_Server
207 if (remaining) *remaining = *ro_slice; 208 if (remaining) *remaining = *ro_slice;
208 ro_slice->len = 0; 209 ro_slice->len = 0;
209 ro_slice->mem = NULL; 210 ro_slice->mem = NULL;
211 efl_io_writer_can_write_set(o, EINA_FALSE);
210 return EINVAL; 212 return EINVAL;
211} 213}
212 214
diff --git a/src/lib/ecore_con/efl_net_socket_fd.c b/src/lib/ecore_con/efl_net_socket_fd.c
index 6902c87cbc..e79fd47d89 100644
--- a/src/lib/ecore_con/efl_net_socket_fd.c
+++ b/src/lib/ecore_con/efl_net_socket_fd.c
@@ -204,7 +204,7 @@ _efl_net_socket_fd_efl_io_reader_read(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UNU
204 rw_slice->len = 0; 204 rw_slice->len = 0;
205 rw_slice->mem = NULL; 205 rw_slice->mem = NULL;
206 206
207 if (err == EAGAIN) efl_io_reader_can_read_set(o, EINA_FALSE); 207 efl_io_reader_can_read_set(o, EINA_FALSE);
208 return err; 208 return err;
209 } 209 }
210 } 210 }
@@ -220,6 +220,7 @@ _efl_net_socket_fd_efl_io_reader_read(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UNU
220 error: 220 error:
221 rw_slice->len = 0; 221 rw_slice->len = 0;
222 rw_slice->mem = NULL; 222 rw_slice->mem = NULL;
223 efl_io_reader_can_read_set(o, EINA_FALSE);
223 return EINVAL; 224 return EINVAL;
224} 225}
225 226
@@ -279,7 +280,7 @@ _efl_net_socket_fd_efl_io_writer_write(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UN
279 if (remaining) *remaining = *ro_slice; 280 if (remaining) *remaining = *ro_slice;
280 ro_slice->len = 0; 281 ro_slice->len = 0;
281 ro_slice->mem = NULL; 282 ro_slice->mem = NULL;
282 if (err == EAGAIN) efl_io_writer_can_write_set(o, EINA_FALSE); 283 efl_io_writer_can_write_set(o, EINA_FALSE);
283 return err; 284 return err;
284 } 285 }
285 } 286 }
@@ -299,6 +300,7 @@ _efl_net_socket_fd_efl_io_writer_write(Eo *o, Efl_Net_Socket_Fd_Data *pd EINA_UN
299 if (remaining) *remaining = *ro_slice; 300 if (remaining) *remaining = *ro_slice;
300 ro_slice->len = 0; 301 ro_slice->len = 0;
301 ro_slice->mem = NULL; 302 ro_slice->mem = NULL;
303 efl_io_writer_can_write_set(o, EINA_FALSE);
302 return EINVAL; 304 return EINVAL;
303} 305}
304 306
diff --git a/src/lib/ecore_con/efl_net_socket_udp.c b/src/lib/ecore_con/efl_net_socket_udp.c
index 6c74e44256..f30a57a591 100644
--- a/src/lib/ecore_con/efl_net_socket_udp.c
+++ b/src/lib/ecore_con/efl_net_socket_udp.c
@@ -532,7 +532,7 @@ _efl_net_socket_udp_efl_io_reader_read(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_
532 rw_slice->len = 0; 532 rw_slice->len = 0;
533 rw_slice->mem = NULL; 533 rw_slice->mem = NULL;
534 534
535 if (err == EAGAIN) efl_io_reader_can_read_set(o, EINA_FALSE); 535 efl_io_reader_can_read_set(o, EINA_FALSE);
536 return err; 536 return err;
537 } 537 }
538 538
@@ -586,6 +586,7 @@ _efl_net_socket_udp_efl_io_reader_read(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina_
586 error: 586 error:
587 rw_slice->len = 0; 587 rw_slice->len = 0;
588 rw_slice->mem = NULL; 588 rw_slice->mem = NULL;
589 efl_io_reader_can_read_set(o, EINA_FALSE);
589 return EINVAL; 590 return EINVAL;
590} 591}
591 592
@@ -610,7 +611,7 @@ _efl_net_socket_udp_efl_io_writer_write(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina
610 if (remaining) *remaining = *ro_slice; 611 if (remaining) *remaining = *ro_slice;
611 ro_slice->len = 0; 612 ro_slice->len = 0;
612 ro_slice->mem = NULL; 613 ro_slice->mem = NULL;
613 if (err == EAGAIN) efl_io_writer_can_write_set(o, EINA_FALSE); 614 efl_io_writer_can_write_set(o, EINA_FALSE);
614 return err; 615 return err;
615 } 616 }
616 } 617 }
@@ -630,6 +631,7 @@ _efl_net_socket_udp_efl_io_writer_write(Eo *o, Efl_Net_Socket_Udp_Data *pd, Eina
630 if (remaining) *remaining = *ro_slice; 631 if (remaining) *remaining = *ro_slice;
631 ro_slice->len = 0; 632 ro_slice->len = 0;
632 ro_slice->mem = NULL; 633 ro_slice->mem = NULL;
634 efl_io_writer_can_write_set(o, EINA_FALSE);
633 return EINVAL; 635 return EINVAL;
634} 636}
635 637