FACT++  1.0
void dna_test_write ( int  conn_id)

Definition at line 335 of file dna.c.

References DNA_CONNECTION::busy, DNA_HEADER::data_size, Dna_conns, dna_write_bytes(), DNA_HEADER::header_magic, DNA_HEADER::header_size, DNA_CONNECTION::read_ast, READ_HEADER_SIZE, STA_DISC, tcpip_failure(), TST_MAGIC, and DNA_CONNECTION::writing.

Referenced by handle_client_request(), and tcpip_test_write().

336 {
337  register DNA_CONNECTION *dna_connp = &Dna_conns[conn_id];
338  register int tcpip_code;
339  DNA_HEADER test_pkt;
340  register DNA_HEADER *test_p = &test_pkt;
341 
342  if(!dna_connp->busy)
343  {
344  return;
345  }
346  if(dna_connp->writing)
347  {
348  return;
349  }
350  test_p->header_size = htovl(READ_HEADER_SIZE);
351  test_p->data_size = 0;
352  test_p->header_magic = htovl(TST_MAGIC);
353  tcpip_code = dna_write_bytes(conn_id, &test_pkt, READ_HEADER_SIZE,0);
354  if(tcpip_failure(tcpip_code)) {
355  /* Connection lost. Signal upper layer ? */
356  if(dna_connp->read_ast)
357  dna_connp->read_ast(conn_id, NULL, 0, STA_DISC);
358  return;
359  }
360 }
static int dna_write_bytes(int conn_id, void *buffer, int size, int nowait)
Definition: dna.c:270
#define READ_HEADER_SIZE
Definition: dna.c:21
int header_magic
Definition: dim.h:357
#define STA_DISC
Definition: dim.h:197
int busy
Definition: dim.h:381
int header_size
Definition: dim.h:355
#define TST_MAGIC
Definition: dim.h:211
int writing
Definition: dim.h:391
int data_size
Definition: dim.h:356
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31
int tcpip_failure(int code)
Definition: tcpip.c:1540
void(* read_ast)()
Definition: dim.h:382

+ Here is the call graph for this function:

+ Here is the caller graph for this function: