|
|
@@ -139,6 +139,7 @@ send_thread(void *arg __unused) |
|
|
|
if (reconnect) |
|
|
|
break; |
|
|
|
|
|
|
|
g_gate_log(LOG_DEBUG, "ggio, ver: %u, unit: %d, seq: %llu, cmd: %u, offset: %llu, len: %llu", ggio.gctl_version, ggio.gctl_unit, ggio.gctl_seq, ggio.gctl_cmd, ggio.gctl_offset, ggio.gctl_length); |
|
|
|
switch (ggio.gctl_cmd) { |
|
|
|
case BIO_READ: |
|
|
|
hdr.gh_cmd = GGATE_CMD_READ; |
|
|
@@ -146,11 +147,24 @@ send_thread(void *arg __unused) |
|
|
|
case BIO_WRITE: |
|
|
|
hdr.gh_cmd = GGATE_CMD_WRITE; |
|
|
|
break; |
|
|
|
case BIO_DELETE: |
|
|
|
hdr.gh_cmd = GGATE_CMD_DELETE; |
|
|
|
break; |
|
|
|
case BIO_FLUSH: |
|
|
|
hdr.gh_cmd = GGATE_CMD_FLUSH; |
|
|
|
break; |
|
|
|
default: |
|
|
|
/* XXX - how to handle this? */ |
|
|
|
g_gate_log(LOG_ERR, "Got unhandled cmd: %d", ggio.gctl_cmd); |
|
|
|
reconnect = 1; |
|
|
|
pthread_kill(recvtd, SIGUSR1); |
|
|
|
break; |
|
|
|
} |
|
|
|
hdr.gh_seq = ggio.gctl_seq; |
|
|
|
hdr.gh_offset = ggio.gctl_offset; |
|
|
|
hdr.gh_length = ggio.gctl_length; |
|
|
|
hdr.gh_error = 0; |
|
|
|
g_gate_log(LOG_DEBUG, "hdr packet, cmd: %hhu, off: %llu, len: %u, seq: %u", hdr.gh_cmd, hdr.gh_offset, hdr.gh_length, hdr.gh_seq); |
|
|
|
g_gate_swap2n_hdr(&hdr); |
|
|
|
|
|
|
|
data = g_gate_send(sendfd, &hdr, sizeof(hdr), MSG_NOSIGNAL); |
|
|
|