From ca9ecafbffd7699364ffdf1978f7b146fd731a70 Mon Sep 17 00:00:00 2001 From: reshke Date: Thu, 7 Mar 2024 11:30:02 +0000 Subject: [PATCH] fix --- sources/frontend.c | 88 ++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/sources/frontend.c b/sources/frontend.c index 74f446255..e347656e4 100644 --- a/sources/frontend.c +++ b/sources/frontend.c @@ -1744,60 +1744,64 @@ static od_frontend_status_t od_frontend_remote(od_client_t *client) } server->parse_msg = NULL; - if (!deployed) { - /* client expects parse complete, send it */ + /* process to see parse reponse. */ + machine_msg_t *msg; + msg = kiwi_fe_write_sync(NULL); + if (msg == NULL) { + status = OD_ESERVER_WRITE; + break; + } + rc = od_write(&server->io, msg); + if (rc == -1) { + status = OD_ESERVER_WRITE; + break; + } - machine_msg_t *pmsg; - pmsg = kiwi_be_write_parse_complete(NULL); - if (pmsg == NULL) { - status = OD_ECLIENT_WRITE; - break; - } - machine_iov_add(server->relay.iov, pmsg); - } else { - /* process to see parse reponse. */ - machine_msg_t *msg; - msg = kiwi_fe_write_sync(NULL); - if (msg == NULL) { - status = OD_ESERVER_WRITE; - break; - } - rc = od_write(&server->io, msg); - if (rc == -1) { - status = OD_ESERVER_WRITE; + /* enter sync point mode */ + server->sync_point = 1; + + /* cleanup from previous runs */ + server->sync_point_parse = 0; + od_server_sync_request(server, 1); + + while (1) { + if (od_server_synchronized(server)) { break; } + // await here - /* enter sync point mode */ - server->sync_point = 1; + od_log(&instance->logger, "sync-point", client, + server, "process await"); + status = od_frontend_remote_process_server( + server, client, true); - /* cleanup from previous runs */ - server->sync_point_parse = 0; - od_server_sync_request(server, 1); + if (status != OD_OK) { + break; + } + } - while (1) { - if (od_server_synchronized(server)) { - break; - } - // await here + server->sync_point = 0; + if (status != OD_OK) { + break; + } + /* sync point ok */ - od_log(&instance->logger, "sync-point", - client, server, "process await"); - status = - od_frontend_remote_process_server( - server, client, true); + if (!deployed) { + /* client expects parse complete, send it */ - if (status != OD_OK) { - break; - } + machine_msg_t *pmsg; + pmsg = kiwi_be_write_parse_complete(NULL); + if (pmsg == NULL) { + status = OD_ECLIENT_WRITE; + break; } - server->sync_point = 0; - if (status != OD_OK) { + rc = od_write(&client->io, pmsg); + if (rc == -1) { + status = OD_ECLIENT_WRITE; break; } - /* sync point ok */ - + } else { /* has prepared statement parse succeseded? * If it does not, empty internals structs. */