Back to index

php5  5.3.10
Functions
mysqlnd_net.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PHPAPI MYSQLND_NET * mysqlnd_net_init (zend_bool persistent TSRMLS_DC)
PHPAPI void mysqlnd_net_free (MYSQLND_NET *const net TSRMLS_DC)
PHPAPI struct
st_mysqlnd_net_methods
mysqlnd_net_get_methods ()

Function Documentation

PHPAPI void mysqlnd_net_free ( MYSQLND_NET *const net  TSRMLS_DC)

Definition at line 920 of file mysqlnd_net.c.

{
       DBG_ENTER("mysqlnd_net_free");

       if (net) {
              zend_bool pers = net->persistent;

              net->m.free_contents(net TSRMLS_CC);
              if (net->cmd_buffer.buffer) {
                     DBG_INF("Freeing cmd buffer");
                     mnd_pefree(net->cmd_buffer.buffer, pers);
                     net->cmd_buffer.buffer = NULL;
              }
              if (net->stream) {
                     DBG_INF_FMT("Freeing stream. abstract=%p", net->stream->abstract);
                     if (pers) {
                            php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
                     } else {
                            php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE);
                     }
                     net->stream = NULL;
              }
              mnd_pefree(net, pers);
       }
       DBG_VOID_RETURN;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 964 of file mysqlnd_net.c.

{
       return &mysqlnd_mysqlnd_net_methods;
}
PHPAPI MYSQLND_NET* mysqlnd_net_init ( zend_bool persistent  TSRMLS_DC)

Definition at line 897 of file mysqlnd_net.c.

{
       size_t alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
       MYSQLND_NET * net = mnd_pecalloc(1, alloc_size, persistent);

       DBG_ENTER("mysqlnd_net_init");
       DBG_INF_FMT("persistent=%u", persistent);
       if (net) {
              net->persistent = persistent;
              net->m = mysqlnd_mysqlnd_net_methods;

              {
                     unsigned int buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
                     net->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
              }
       }
       DBG_RETURN(net);
}

Here is the call graph for this function:

Here is the caller graph for this function: