SICS-764: Provide access to the asynnet socket descriptor's write buffer.
We need this to implement a "capture" command that doesn't cause SICS to commit suicide if you capture a "run" command. NOTE: This is a bit dodgy because we're trusting callers not to modify the write buffer.
This commit is contained in:
11
asynnet.c
11
asynnet.c
@ -632,3 +632,14 @@ int ANETreadTillTerm(int handle,
|
||||
}
|
||||
return ANETTIMEOUT;
|
||||
}
|
||||
|
||||
char *ANETgetWBuffer(int handle) {
|
||||
pSocketDescriptor sock;
|
||||
int len;
|
||||
char *wdata;
|
||||
|
||||
sock = findSocketDescriptor(handle);
|
||||
wdata = (char *) GetRWBufferData(sock->writeBuffer, &len);
|
||||
wdata[len] = '\0';
|
||||
return wdata;
|
||||
}
|
||||
|
Reference in New Issue
Block a user