forked from enlightenment/efl
evas/cserve2: Use Slave_Command instead of
Message_Type for slave. This is the command that must be given to the slave, instead of the message type received from the client. SVN revision: 71602
This commit is contained in:
parent
a3fa30f70b
commit
ce514d3d43
|
@ -68,6 +68,8 @@ typedef struct _Image_Load_Opts Image_Load_Opts;
|
||||||
typedef enum {
|
typedef enum {
|
||||||
IMAGE_OPEN,
|
IMAGE_OPEN,
|
||||||
IMAGE_LOAD,
|
IMAGE_LOAD,
|
||||||
|
FONT_LOAD,
|
||||||
|
FONT_GLYPHS_LOAD,
|
||||||
SLAVE_QUIT,
|
SLAVE_QUIT,
|
||||||
ERROR
|
ERROR
|
||||||
} Slave_Command;
|
} Slave_Command;
|
||||||
|
|
|
@ -34,11 +34,11 @@ static struct _Request_Match
|
||||||
{
|
{
|
||||||
Font_Request_Type rtype;
|
Font_Request_Type rtype;
|
||||||
Slave_Type stype;
|
Slave_Type stype;
|
||||||
Message_Type mtype;
|
Slave_Command ctype;
|
||||||
} _request_match[] =
|
} _request_match[] =
|
||||||
{
|
{
|
||||||
{ CSERVE2_REQ_FONT_LOAD, SLAVE_FONT, CSERVE2_FONT_LOAD },
|
{ CSERVE2_REQ_FONT_LOAD, SLAVE_FONT, FONT_LOAD },
|
||||||
{ CSERVE2_REQ_FONT_GLYPHS_LOAD, SLAVE_FONT, CSERVE2_FONT_GLYPHS_LOAD },
|
{ CSERVE2_REQ_FONT_GLYPHS_LOAD, SLAVE_FONT, GLYPHS_LOAD },
|
||||||
{ CSERVE2_REQ_LAST, 0 }
|
{ CSERVE2_REQ_LAST, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ _slave_for_request_create(Slave_Type type)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_cserve2_request_dispatch(Slave_Worker *sw, Message_Type mtype, Font_Request *req)
|
_cserve2_request_dispatch(Slave_Worker *sw, Slave_Command ctype, Font_Request *req)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
char *slave_msg = req->funcs->msg_create(req->data, &size);
|
char *slave_msg = req->funcs->msg_create(req->data, &size);
|
||||||
|
@ -256,7 +256,7 @@ _cserve2_request_dispatch(Slave_Worker *sw, Message_Type mtype, Font_Request *re
|
||||||
|
|
||||||
req->msg = slave_msg;
|
req->msg = slave_msg;
|
||||||
sw->data = req;
|
sw->data = req;
|
||||||
cserve2_slave_send(sw->slave, mtype, slave_msg, size);
|
cserve2_slave_send(sw->slave, ctype, slave_msg, size);
|
||||||
req->processing = EINA_TRUE;
|
req->processing = EINA_TRUE;
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -285,7 +285,7 @@ cserve2_requests_process(void)
|
||||||
for (rtype = 0; rtype < CSERVE2_REQ_LAST; rtype++)
|
for (rtype = 0; rtype < CSERVE2_REQ_LAST; rtype++)
|
||||||
{
|
{
|
||||||
Slave_Type type = SLAVE_NONE;
|
Slave_Type type = SLAVE_NONE;
|
||||||
Message_Type mtype;
|
Slave_Command ctype;
|
||||||
unsigned int max_workers;
|
unsigned int max_workers;
|
||||||
Eina_List **idle, **working;
|
Eina_List **idle, **working;
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ cserve2_requests_process(void)
|
||||||
if (_request_match[j].rtype == j)
|
if (_request_match[j].rtype == j)
|
||||||
{
|
{
|
||||||
type = _request_match[j].stype;
|
type = _request_match[j].stype;
|
||||||
mtype = _request_match[j].mtype;
|
ctype = _request_match[j].ctype;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ cserve2_requests_process(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
sw = eina_list_data_get(*idle);
|
sw = eina_list_data_get(*idle);
|
||||||
if (!_cserve2_request_dispatch(sw, mtype, req))
|
if (!_cserve2_request_dispatch(sw, ctype, req))
|
||||||
{
|
{
|
||||||
ERR("Could not dispatch request.");
|
ERR("Could not dispatch request.");
|
||||||
_cserve2_request_failed(req, CSERVE2_GENERIC);
|
_cserve2_request_failed(req, CSERVE2_GENERIC);
|
||||||
|
|
Loading…
Reference in New Issue