tcp_utils.h File Reference


Detailed Description

HTTP embedded server library Copyright (C) 2006-2007 Olivier Singla http://mihl.sourceforge.net/.

Definition in file tcp_utils.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int tcp_read (SOCKET sockfd, char *buffer, int maxlen)
 TBD.
int tcp_write (SOCKET sockfd, const char *buff, int buff_len)
 TBD.
void decode_keys_values (mihl_cnx_t *cnx, char *_request, int *nb_options, char *options_names[], char *options_values[], int maxnb_options, int *nb_variables, char *vars_names[], char *vars_values[], int maxnb_values)
 TBD.
int read_file (char const *fname, char **file, int *length)
 Read en entire file in memory.


Function Documentation

int tcp_read ( SOCKET  sockfd,
char *  buffer,
int  maxlen 
)

TBD.

Parameters:
sockfd TBD
buffer TBD
maxlen TBD
Returns:
  • X
  • or -1 if an error occurred (errno is then set).

Definition at line 47 of file tcp_utils.c.

References ERRNO, and Sleep.

Referenced by got_data_for_active_connexion().

Here is the caller graph for this function:

int tcp_write ( SOCKET  sockfd,
const char *  buff,
int  buff_len 
)

TBD.

Parameters:
sockfd TBD
buff TBD
buff_len TBD
Returns:
  • X
  • or -1 if an error occurred (errno is then set).

Definition at line 104 of file tcp_utils.c.

References ERRNO, and Sleep.

Referenced by mihl_send(), and send_file().

Here is the caller graph for this function:

void decode_keys_values ( mihl_cnx_t cnx,
char *  _request,
int *  nb_options,
char *  options_names[],
char *  options_values[],
int  maxnb_options,
int *  nb_variables,
char *  vars_names[],
char *  vars_values[],
int  maxnb_values 
)

TBD.

Called by: got_data_for_active_connexion

Parameters:
cnx opaque context structure as returned by mihl_init()
_request TBD
[out] nb_options TBD
[out] options_names TBD
[out] options_values TBD
maxnb_options TBD
[out] nb_variables TBD
[out] vars_names TBD
[out] vars_values TBD
maxnb_values TBD

Definition at line 156 of file tcp_utils.c.

References mihl_cnx::authorization, mihl_cnxinfo_t::host, mihl_cnx::info, mihl_cnx::is_keep_alive, mihl_cnx::keep_alive, and mihl_cnxinfo_t::user_agent.

Referenced by got_data_for_active_connexion().

Here is the caller graph for this function:

int read_file ( char const *  fname,
char **  file,
int *  length 
)

Read en entire file in memory.

The buffer is dynamically allocated (malloc).

Parameters:
fname TBD
file TBD
length TBD
Returns:
  • The length of the file
  • or -1 if an error occurred (errno is then set).

Definition at line 350 of file tcp_utils.c.

References filelength(), and O_BINARY.

Referenced by send_file().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon May 26 18:06:15 2008 for milh-example_2 by  doxygen 1.5.6