From: Jiří Škrábal Date: Wed, 8 Dec 2004 11:37:21 +0000 (+0000) Subject: - using right data for buffers and for comunication X-Git-Tag: glite-wms-utils-exception_R_1_0_0~30 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=5813fd0a190a3013e93e93cd6993bf20b32756c9;p=jra1mw.git - using right data for buffers and for comunication - LB proxy API changes --- diff --git a/org.glite.lb.client/project/version.properties b/org.glite.lb.client/project/version.properties index 96de287..69658fd 100644 --- a/org.glite.lb.client/project/version.properties +++ b/org.glite.lb.client/project/version.properties @@ -1,4 +1,4 @@ -#Wed Dec 08 06:00:32 CET 2004 -module.version=0.4.0 +#Tue Dec 07 06:07:53 CET 2004 +module.version=0.5.0 module.build=110 module.age=2 diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index 0346f73..173ef47 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -106,10 +106,9 @@ int edg_wll_close(edg_wll_Context ctx) int edg_wll_close_proxy(edg_wll_Context ctx) { - close(ctx->connPlain->sock); - ctx->connPlain->sock = 0; - - return edg_wll_Error(ctx,NULL,NULL); + edg_wll_plain_close(&ctx->connProxy->conn); + + return edg_wll_Error(ctx, NULL, NULL); } @@ -196,8 +195,8 @@ int edg_wll_open_proxy(edg_wll_Context ctx) int flags; - ctx->connPlain->sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (ctx->connPlain->sock < 0) { + ctx->connProxy->conn.sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (ctx->connProxy->conn.sock < 0) { edg_wll_SetError(ctx, errno, "socket() error"); goto err; } @@ -216,13 +215,13 @@ int edg_wll_open_proxy(edg_wll_Context ctx) } strcpy(saddr.sun_path, ctx->p_lbproxy_serve_sock); - if ((flags = fcntl(ctx->connPlain->sock, F_GETFL, 0)) < 0 || - fcntl(ctx->connPlain->sock, F_SETFL, flags | O_NONBLOCK) < 0) { + if ((flags = fcntl(ctx->connProxy->conn.sock, F_GETFL, 0)) < 0 || + fcntl(ctx->connProxy->conn.sock, F_SETFL, flags | O_NONBLOCK) < 0) { edg_wll_SetError(ctx, errno, "fcntl()"); goto err; } - if (connect(ctx->connPlain->sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { + if (connect(ctx->connProxy->conn.sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) { edg_wll_SetError(ctx, errno, "connect()"); goto err; } diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index 1428f85..49a3257 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -165,7 +165,7 @@ int edg_wll_log_proto_client_failure(edg_wll_Context context, int code, edg_wll_ */ static int -get_reply(edg_wll_Context context, edg_wll_Connection *conn, char **buf, int *code_min) +get_reply(edg_wll_Context context, edg_wll_PlainConnection *conn, char **buf, int *code_min) { char buffer[17]; char *msg, *p; @@ -243,7 +243,7 @@ get_reply_end: * *---------------------------------------------------------------------- */ -int edg_wll_log_proto_client_proxy(edg_wll_Context context, edg_wll_Connection *conn, edg_wll_LogLine logline) +int edg_wll_log_proto_client_proxy(edg_wll_Context context, edg_wll_PlainConnection *conn, edg_wll_LogLine logline) { char *p; int len; char *ucs = "honik6"; diff --git a/org.glite.lb.client/src/prod_proto.h b/org.glite.lb.client/src/prod_proto.h index c804256..2945cf1 100644 --- a/org.glite.lb.client/src/prod_proto.h +++ b/org.glite.lb.client/src/prod_proto.h @@ -20,7 +20,7 @@ extern "C" { int edg_wll_log_proto_client(edg_wll_Context context, edg_wll_GssConnection *con, edg_wll_LogLine logline/*, int priority,*/); int edg_wll_log_proto_client_failure(edg_wll_Context context, int code, edg_wll_GssStatus *gss_code, const char *text); -int edg_wll_log_proto_client_proxy(edg_wll_Context context, edg_wll_Connection *conn, edg_wll_LogLine logline); +int edg_wll_log_proto_client_proxy(edg_wll_Context context, edg_wll_PlainConnection *conn, edg_wll_LogLine logline); #ifdef __cplusplus } diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index 7e0ee5d..b0b8737 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -170,7 +170,7 @@ static int edg_wll_DoLogEventProxy( int answer; struct sockaddr_un saddr; int flags; - edg_wll_Connection conn; + edg_wll_PlainConnection conn; edg_wll_ResetError(context); answer = 0; @@ -208,7 +208,7 @@ static int edg_wll_DoLogEventProxy( answer = edg_wll_log_proto_client_proxy(context,&conn,logline); - close(conn.sock); + edg_wll_plain_close(&conn); edg_wll_DoLogEventProxy_end: