From: <ta...@us...> - 2007-08-29 02:25:39
|
Revision: 3787 http://gfarm.svn.sourceforge.net/gfarm/?rev=3787&view=rev Author: tatebe Date: 2007-08-28 19:25:37 -0700 (Tue, 28 Aug 2007) Log Message: ----------- do not call gfp_xdr_flush() in gfp_xdr_vrecv instead call it in *_client_rpc_result and gfp_xdr_vrpc for a compound procedure. Modified Paths: -------------- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_client.c gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_server.c gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfm_client.c gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfp_xdr.c gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfs_client.c gfarm/branches/gfarm_v2/server/gfmd/subr.c gfarm/branches/gfarm_v2/server/gfsd/gfsd.c Modified: gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_client.c =================================================================== --- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_client.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_client.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -91,6 +91,8 @@ break; } e = gfp_xdr_send(conn, "i", GFARM_AUTH_SHAREDSECRET_MD5); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_recv(conn, 0, &eof, "i", &error); @@ -111,6 +113,8 @@ response); e = gfp_xdr_send(conn, "ib", expire, sizeof(response), response); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_recv(conn, 1, &eof, "i", &error); @@ -124,6 +128,8 @@ error == GFARM_AUTH_ERROR_EXPIRED); e = gfp_xdr_send(conn, "i", GFARM_AUTH_SHAREDSECRET_GIVEUP); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_recv(conn, 0, &eof, "i", &error_ignore); @@ -188,6 +194,8 @@ (methods & server_methods & (1 << method)) == 0) continue; e = gfp_xdr_send(conn, "i", method); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_recv(conn, 1, &eof, "i", &error); Modified: gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_server.c =================================================================== --- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_server.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/auth_server.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -127,6 +127,8 @@ gfarm_auth_random(challenge, sizeof(challenge)); e = gfp_xdr_send(conn, "b", sizeof(challenge), challenge); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error("auth_sharedsecret: challenge: %s", gfarm_error_string(e)); @@ -383,6 +385,8 @@ methods_buffer[nmethods++] = i; } e = gfp_xdr_send(conn, "b", nmethods, methods_buffer); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error("%s: %s", hostname, gfarm_error_string(e)); return (e); Modified: gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfm_client.c =================================================================== --- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfm_client.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfm_client.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -166,6 +166,10 @@ gfarm_error_t e; int errcode; + e = gfp_xdr_flush(gfm_server->conn); + if (e != GFARM_ERR_NO_ERROR) + return (e); + va_start(ap, format); e = gfp_xdr_vrpc_result(gfm_server->conn, just, &errcode, &format, &ap); Modified: gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfp_xdr.c =================================================================== --- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfp_xdr.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfp_xdr.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -295,12 +295,9 @@ size_t *szp, sz; size_t size; int overflow = 0; - gfarm_error_t e; - e = gfp_xdr_flush(conn); - if (e != GFARM_ERR_NO_ERROR) - return (e); + /* do not call gfp_xdr_flush() here for a compound procedure */ *eofp = 1; for (; *format; format++) { @@ -516,6 +513,8 @@ * send request */ e = gfp_xdr_vrpc_request(conn, command, formatp, app); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) return (e); Modified: gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfs_client.c =================================================================== --- gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfs_client.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/lib/libgfarm/gfarm/gfs_client.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -943,6 +943,10 @@ gfarm_error_t e; int errcode; + e = gfp_xdr_flush(gfs_server->conn); + if (e != GFARM_ERR_NO_ERROR) + return (e); + va_start(ap, format); e = gfp_xdr_vrpc_result(gfs_server->conn, just, &errcode, &format, &ap); @@ -1381,6 +1385,8 @@ e = gfs_client_rpc_request(gfs_server, GFS_PROTO_REPLICA_RECV, "ll", ino, gen); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(gfs_server->conn); if (e != GFARM_ERR_NO_ERROR) return (e); Modified: gfarm/branches/gfarm_v2/server/gfmd/subr.c =================================================================== --- gfarm/branches/gfarm_v2/server/gfmd/subr.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/server/gfmd/subr.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -157,6 +157,7 @@ "invalid format character to put reply"); } va_end(ap); + /* do not call gfp_xdr_flush() here for a compound protocol */ - return (ecode); + return (e); } Modified: gfarm/branches/gfarm_v2/server/gfsd/gfsd.c =================================================================== --- gfarm/branches/gfarm_v2/server/gfsd/gfsd.c 2007-08-28 04:08:32 UTC (rev 3786) +++ gfarm/branches/gfarm_v2/server/gfsd/gfsd.c 2007-08-29 02:25:37 UTC (rev 3787) @@ -354,13 +354,12 @@ diag, (int)ecode, gfarm_error_string(ecode)); e = gfp_xdr_send(client, "i", ecode); + if (ecode == GFARM_ERR_NO_ERROR) + e = gfp_xdr_vsend(client, &format, app); + if (e == GFARM_ERR_NO_ERROR) + e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) fatal("%s: %s", diag, gfarm_error_string(e)); - if (ecode == GFARM_ERR_NO_ERROR) { - e = gfp_xdr_vsend(client, &format, app); - if (e != GFARM_ERR_NO_ERROR) - fatal("%s: %s", diag, gfarm_error_string(e)); - } if (ecode == GFARM_ERR_NO_ERROR && *format != '\0') fatal("%s: invalid format character `%c' to put reply", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |