os: Hide the Connection{In,Out}put implementation details
Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
e2c7d70e5d
commit
092c57ab17
|
@ -1038,8 +1038,8 @@ CloseDownConnection(ClientPtr client)
|
||||||
if (FlushCallback)
|
if (FlushCallback)
|
||||||
CallCallbacks(&FlushCallback, NULL);
|
CallCallbacks(&FlushCallback, NULL);
|
||||||
|
|
||||||
if (oc->output && oc->output->count)
|
if (oc->output)
|
||||||
FlushClient(client, oc, (char *) NULL, 0);
|
FlushClient(client, oc, (char *) NULL, 0);
|
||||||
#ifdef XDMCP
|
#ifdef XDMCP
|
||||||
XdmcpCloseDisplay(oc->fd);
|
XdmcpCloseDisplay(oc->fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
21
os/io.c
21
os/io.c
|
@ -82,6 +82,23 @@ SOFTWARE.
|
||||||
CallbackListPtr ReplyCallback;
|
CallbackListPtr ReplyCallback;
|
||||||
CallbackListPtr FlushCallback;
|
CallbackListPtr FlushCallback;
|
||||||
|
|
||||||
|
typedef struct _connectionInput {
|
||||||
|
struct _connectionInput *next;
|
||||||
|
char *buffer; /* contains current client input */
|
||||||
|
char *bufptr; /* pointer to current start of data */
|
||||||
|
int bufcnt; /* count of bytes in buffer */
|
||||||
|
int lenLastReq;
|
||||||
|
int size;
|
||||||
|
unsigned int ignoreBytes; /* bytes to ignore before the next request */
|
||||||
|
} ConnectionInput, *ConnectionInputPtr;
|
||||||
|
|
||||||
|
typedef struct _connectionOutput {
|
||||||
|
struct _connectionOutput *next;
|
||||||
|
unsigned char *buf;
|
||||||
|
int size;
|
||||||
|
int count;
|
||||||
|
} ConnectionOutput, *ConnectionOutputPtr;
|
||||||
|
|
||||||
static ConnectionInputPtr AllocateInputBuffer(void);
|
static ConnectionInputPtr AllocateInputBuffer(void);
|
||||||
static ConnectionOutputPtr AllocateOutputBuffer(void);
|
static ConnectionOutputPtr AllocateOutputBuffer(void);
|
||||||
|
|
||||||
|
@ -845,8 +862,8 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
|
||||||
long notWritten;
|
long notWritten;
|
||||||
long todo;
|
long todo;
|
||||||
|
|
||||||
if (!oco)
|
if (!oco || !oco->count)
|
||||||
return 0;
|
return 0;
|
||||||
written = 0;
|
written = 0;
|
||||||
padsize = padding_for_int32(extraCount);
|
padsize = padding_for_int32(extraCount);
|
||||||
notWritten = oco->count + extraCount + padsize;
|
notWritten = oco->count + extraCount + padsize;
|
||||||
|
|
18
os/osdep.h
18
os/osdep.h
|
@ -107,22 +107,8 @@ typedef Bool (*AddAuthorFunc) (unsigned name_length, const char *name,
|
||||||
unsigned data_length, char *data);
|
unsigned data_length, char *data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _connectionInput {
|
typedef struct _connectionInput *ConnectionInputPtr;
|
||||||
struct _connectionInput *next;
|
typedef struct _connectionOutput *ConnectionOutputPtr;
|
||||||
char *buffer; /* contains current client input */
|
|
||||||
char *bufptr; /* pointer to current start of data */
|
|
||||||
int bufcnt; /* count of bytes in buffer */
|
|
||||||
int lenLastReq;
|
|
||||||
int size;
|
|
||||||
unsigned int ignoreBytes; /* bytes to ignore before the next request */
|
|
||||||
} ConnectionInput, *ConnectionInputPtr;
|
|
||||||
|
|
||||||
typedef struct _connectionOutput {
|
|
||||||
struct _connectionOutput *next;
|
|
||||||
unsigned char *buf;
|
|
||||||
int size;
|
|
||||||
int count;
|
|
||||||
} ConnectionOutput, *ConnectionOutputPtr;
|
|
||||||
|
|
||||||
struct _osComm;
|
struct _osComm;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue