summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vxi11_server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index 1bf7889..79ff9f7 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -49,6 +49,7 @@ typedef struct {
int lid;
int sock;
GTimeVal lastactivity;
+ bool aborted;
} ActiveLink;
static ActiveLink* links[MAX_SESSIONS] = { NULL };
@@ -171,6 +172,7 @@ device_abort_1_svc(Device_Link *argp, struct svc_req *rqstp) {
if (!isValidLink(*argp))
result.error = ERR_INVALIDLINKINDENTIFIER;
else {
+ links[*argp]->aborted = true;
result.error = 0;
}
return &result;
@@ -241,6 +243,7 @@ device_write_1_svc(Device_WriteParms *argp, struct svc_req *rqstp) {
result.error = ERR_IOTIMEOUT;
else {
touchlink(argp->lid);
+ links[argp->lid]->aborted = false;
gchar* str = g_strndup(argp->data.data_val, argp->data.data_len);
#ifdef DEBUG
int n;
@@ -290,6 +293,11 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
else
result.data.data_val = NULL;
+ if (links[argp->lid]->aborted) {
+ result.error = ERR_ABORT;
+ links[argp->lid]->aborted = false;
+ }
+
result.reason = 0x4;
}
return &result;