- using right data for buffers and for comunication
authorJiří Škrábal <nykolas@ics.muni.cz>
Wed, 8 Dec 2004 11:37:21 +0000 (11:37 +0000)
committerJiří Škrábal <nykolas@ics.muni.cz>
Wed, 8 Dec 2004 11:37:21 +0000 (11:37 +0000)
- LB proxy API changes

org.glite.lb.client/project/version.properties
org.glite.lb.client/src/connection.c
org.glite.lb.client/src/prod_proto.c
org.glite.lb.client/src/prod_proto.h
org.glite.lb.client/src/producer.c

index 96de287..69658fd 100644 (file)
@@ -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
index 0346f73..173ef47 100644 (file)
@@ -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;
        }
index 1428f85..49a3257 100644 (file)
@@ -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";
index c804256..2945cf1 100644 (file)
@@ -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
 }
index 7e0ee5d..b0b8737 100644 (file)
@@ -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: