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;
|
||||
}
|
||||
|
@ -207,4 +207,9 @@ int ANETreadTillTerm(int handle,
|
||||
* \param userData An opaque pointer with data for lcb
|
||||
*/
|
||||
void ANETsetLog(ANETlog lcb, void *userData);
|
||||
/**
|
||||
* \brief Return a pointer to the socket descriptor write buffer
|
||||
* \param handle Connection object socket handle
|
||||
*/
|
||||
char *ANETgetWBuffer(int handle);
|
||||
#endif /*ASYNNET_H_ */
|
||||
|
Reference in New Issue
Block a user