FACT++  1.0
static int do_dna_write ( int  id)
static

Definition at line 370 of file dna.c.

References buffer, WRITE_ITEM::buffer, DNA_CONNECTION::busy, WRITE_ITEM::conn_id, Dna_conns, dna_write_bytes(), FALSE, Memory::free(), id_free(), id_get_ptr(), size, WRITE_ITEM::size, SRC_DNA, tcpip_failure(), TRUE, and DNA_CONNECTION::writing.

Referenced by dna_write().

371 {
372  register DNA_CONNECTION *dna_connp;
373  int tcpip_code;
374  WRITE_ITEM *ptr;
375  int conn_id, size;
376  void *buffer;
377 
378  ptr = (WRITE_ITEM *)id_get_ptr(id, SRC_DNA);
379  if(!ptr)
380  return(2);
381  conn_id = ptr->conn_id;
382  buffer = ptr->buffer;
383  size = ptr->size;
384 
385  dna_connp = &Dna_conns[conn_id];
386  if(!dna_connp->busy)
387  {
388  id_free(id, SRC_DNA);
389  free(buffer);
390  free(ptr);
391  return(2);
392  }
393  dna_connp->writing = TRUE;
394  tcpip_code = dna_write_bytes(conn_id, buffer, size,0);
395  if(tcpip_failure(tcpip_code))
396  {
397  dna_connp->writing = FALSE;
398  id_free(id, SRC_DNA);
399  free(buffer);
400  free(ptr);
401  return(0);
402  }
403 
404  id_free(id, SRC_DNA);
405  free(buffer);
406  free(ptr);
407 
408  dna_connp->writing = FALSE;
409  return(1);
410 }
int conn_id
Definition: dna.c:364
static int dna_write_bytes(int conn_id, void *buffer, int size, int nowait)
Definition: dna.c:270
#define TRUE
Definition: dim.h:135
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
int busy
Definition: dim.h:381
#define FALSE
Definition: dim.h:136
int size
Definition: dna.c:366
int writing
Definition: dim.h:391
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17
void id_free(int id, SRC_TYPES type)
Definition: conn_handler.c:206
void free(void *mem)
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31
int tcpip_failure(int code)
Definition: tcpip.c:1540
void * buffer
Definition: dna.c:365

+ Here is the call graph for this function:

+ Here is the caller graph for this function: