|
|
| version 1.1.1.1.2.5, 2010/06/23 15:07:15 | version 1.1.1.1.2.6, 2010/06/23 16:23:31 |
|---|---|
| Line 185 rpc_srv_dispatchVars(void *arg) | Line 185 rpc_srv_dispatchVars(void *arg) |
| rpc_blob_t *b; | rpc_blob_t *b; |
| int cx, ret; | int cx, ret; |
| fd_set fds; | fd_set fds; |
| u_char buf[BLOBSIZ]; | u_char buf[sizeof(struct tagBLOBHdr)]; |
| struct tagBLOBHdr *blob; | struct tagBLOBHdr *blob; |
| if (!arg) { | if (!arg) { |
| Line 204 rpc_srv_dispatchVars(void *arg) | Line 204 rpc_srv_dispatchVars(void *arg) |
| if (ret == -1) { | if (ret == -1) { |
| ret = -2; | ret = -2; |
| } | } |
| memset(buf, 0, BLOBSIZ); | memset(buf, 0, sizeof buf); |
| if ((ret = recv(c->cli_sock, buf, BLOBSIZ, 0)) == -1) { | if ((ret = recv(c->cli_sock, buf, sizeof buf, 0)) == -1) { |
| LOGERR; | LOGERR; |
| ret = -3; | ret = -3; |
| break; | break; |
| Line 235 rpc_srv_dispatchVars(void *arg) | Line 235 rpc_srv_dispatchVars(void *arg) |
| } | } |
| switch (blob->hdr_cmd) { | switch (blob->hdr_cmd) { |
| case get: | case get: |
| ret = rpc_srv_sendBLOB(c, b); | if (rpc_srv_blobMap(s, b) != -1) { |
| ret = rpc_srv_sendBLOB(c, b); | |
| rpc_srv_blobUnmap(b); | |
| } else | |
| ret = -7; | |
| break; | break; |
| case set: | case set: |
| ret = rpc_srv_recvBLOB(c, b); | ret = rpc_srv_recvBLOB(c, b); |
| if (ret == -1) | |
| ret = -7; | |
| break; | break; |
| case unset: | case unset: |
| ret = rpc_srv_freeBLOB(b); | ret = rpc_srv_deleteBLOB(c, b); |
| if (ret == -1) | |
| ret = -7; | |
| break; | break; |
| default: | default: |
| rpc_SetErr(EINVAL, "Error:: unsupported BLOB command (%d)...\n", | rpc_SetErr(EINVAL, "Error:: unsupported BLOB command (%d)...\n", |
| blob->hdr_cmd); | blob->hdr_cmd); |
| ret -7; | ret -7; |
| } | } |
| // Replay to client! | |
| } while (ret > -1); | } while (ret > -1); |
| shutdown(c->cli_sock, SHUT_RDWR); | shutdown(c->cli_sock, SHUT_RDWR); |