summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_client.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-06-20 14:11:32 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-06-20 17:42:07 +0900
commit4b473c90c0b391a9b2940a4461d2a481f43c2018 (patch)
treeccdd4389cb7780c746849c8df133abee57e7c8c6 /src/lib/evas/cserve2/evas_cs2_client.c
parent1821c91d1076e5350fce7ed92d2ea670518338e1 (diff)
cserve2: Handle interrupts when failing to read from server
If we don't do that, the client will end up in an infinite loop from where it just can't exit, if the server is dead/stuck.
Diffstat (limited to 'src/lib/evas/cserve2/evas_cs2_client.c')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index 22129552ef..5830c4567c 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -360,6 +360,11 @@ _server_dispatch_until(unsigned int rid)
360 * Or maybe just return EINA_FALSE after some timeout? 360 * Or maybe just return EINA_FALSE after some timeout?
361 * -- jpeg 361 * -- jpeg
362 */ 362 */
363 if (errno == EINTR)
364 {
365 DBG("giving up on request %d after interrupt", rid);
366 return EINA_FALSE;
367 }
363 } 368 }
364 } 369 }
365 } 370 }
@@ -638,7 +643,7 @@ _image_open_server_send(Image_Entry *ie, const char *file, const char *key, Evas
638 return msg_open.base.rid; 643 return msg_open.base.rid;
639} 644}
640 645
641unsigned int 646static unsigned int
642_image_setopts_server_send(Image_Entry *ie) 647_image_setopts_server_send(Image_Entry *ie)
643{ 648{
644 File_Entry *fentry; 649 File_Entry *fentry;
@@ -651,6 +656,8 @@ _image_setopts_server_send(Image_Entry *ie)
651 fentry = ie->data1; 656 fentry = ie->data1;
652 657
653 dentry = calloc(1, sizeof(*dentry)); 658 dentry = calloc(1, sizeof(*dentry));
659 if (!dentry)
660 return 0;
654 661
655 memset(&msg, 0, sizeof(msg)); 662 memset(&msg, 0, sizeof(msg));
656 dentry->image_id = ++_data_id; 663 dentry->image_id = ++_data_id;
@@ -681,7 +688,10 @@ _image_setopts_server_send(Image_Entry *ie)
681 msg.opts.orientation = ie->load_opts.orientation; 688 msg.opts.orientation = ie->load_opts.orientation;
682 689
683 if (!_server_send(&msg, sizeof(msg), NULL, NULL)) 690 if (!_server_send(&msg, sizeof(msg), NULL, NULL))
684 return 0; 691 {
692 free(dentry);
693 return 0;
694 }
685 695
686 ie->data2 = dentry; 696 ie->data2 = dentry;
687 697