diff options
author | unknown <hf@bison.(none)> | 2002-06-17 16:24:51 +0500 |
---|---|---|
committer | unknown <hf@bison.(none)> | 2002-06-17 16:24:51 +0500 |
commit | f4b014d5c3ebac7e4c9eff57206d33f5fe6455ed (patch) | |
tree | 32ae61185744bab280ae5b44c652879d9331f198 /libmysqld/lib_vio.c | |
parent | c1f3be5bb5f70e5d0376f258b79ccffa5b2d9c2b (diff) | |
download | mariadb-git-f4b014d5c3ebac7e4c9eff57206d33f5fe6455ed.tar.gz |
Removing net emulation out of embedded library
include/mysql.h:
Several structures content changed for embedded case
include/violite.h:
enum_vio_type extended
libmysqld/embedded_priv.h:
three new funcs added
libmysqld/lib_sql.cc:
A lot of changes on the way to excude network emulation
libmysqld/lib_vio.c:
vio structure changed.
we're on the way to remove network...
libmysqld/libmysqld.c:
A lot of changes.
sql/ha_myisam.cc:
Network sending modified for embedded case.
sql/net_pkg.cc:
Exclude network from error sending
sql/sql_acl.cc:
Exclude access permissions checking in embedded case
sql/sql_base.cc:
Implementation of send_fields got quite different in enbedded case and now
placed in lib_sql.cc
sql/sql_class.cc:
select_send::send_data for embedded case placed in lib_sql
sql/sql_class.h:
Extra fields added for embedded case
sql/sql_parse.cc:
remove this out of server
sql/sql_show.cc:
lots of similar changes to exclude network emulation
sql/sql_table.cc:
Network emulation excluded
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'libmysqld/lib_vio.c')
-rw-r--r-- | libmysqld/lib_vio.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/libmysqld/lib_vio.c b/libmysqld/lib_vio.c index 9bf492ed5ea..a4388ba0995 100644 --- a/libmysqld/lib_vio.c +++ b/libmysqld/lib_vio.c @@ -42,14 +42,7 @@ struct st_vio { - my_socket sd; /* my_socket - real or imaginary */ - HANDLE hPipe; - my_bool localhost; /* Are we from localhost? */ - int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ - struct sockaddr_in local; /* Local internet address */ - struct sockaddr_in remote; /* Remote internet address */ enum enum_vio_type type; /* Type of connection */ - char desc[30]; /* String description */ void *dest_thd; char *packets, **last_packet; char *where_in_packet, *end_of_packet; @@ -57,6 +50,7 @@ struct st_vio MEM_ROOT root; }; + /* Initialize the communication buffer */ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) @@ -68,6 +62,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) init_alloc_root(&vio->root, 8192, 8192); vio->root.min_malloc = sizeof(char *) + 4; vio->last_packet = &vio->packets; + vio->type = type; } return (vio); } @@ -212,4 +207,22 @@ my_bool vio_poll_read(Vio *vio,uint timeout) return 0; } +int create_vio(NET *net, int separate_thread) +{ + Vio * v = net->vio; + if (!v) + { + v = vio_new(0, separate_thread ? VIO_SHARED_MEMORY : VIO_BUFFER, 0); + net->vio = v; + } + return !v; +} + +void set_thd(Vio *v, void *thd) +{ + if (v) + { + v -> dest_thd = thd; + } +} #endif /* HAVE_VIO */ |