summaryrefslogtreecommitdiff
path: root/vio/viosocket.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug#47571 : idle named pipe connection is unkillableVladislav Vaintroub2009-11-201-20/+29
| | | | implement Davi's review suggestions (post-push fixes)
* Bug#47571: idle named pipe connection is unkillableVladislav Vaintroub2009-11-021-30/+90
| | | | | | | | | | | | | | | | | | | | | | Bug#31621: Windows server hanging during shutdown using named pipes and idle connection Problem: when idle pipe connection is forcefully closed with KILL statement or when the server goes down, thread that is closing connection would hang infinitely in CloseHandle(). The reason for the hang is that named pipe operations are performed synchronously. In this mode all IOs on pipe are serialized, that is CloseHandle() will not abort ReadFile() in another thread, but wait for ReadFile() to complete. The fix implements asynchrnous mode for named pipes, where operation of file are not synchronized. Read/Write operation would fire an async IO and wait for either IO completion or timeout. Note, that with this patch timeouts are properly handled for named pipes. Post-review: Win32 timeout code has been fixed for named pipes and shared memory. We do not store pointer to NET in vio structure, only the read and write timeouts.
* Bug#33899: Deadlock in mysql_real_query with shared memory connectionsDavi Arnaut2009-03-261-7/+15
|\ | | | | | | | | | | | | | | | | | | | | The problem is that the read and write methods of the shared memory transport (protocol) didn't react to asynchornous close events, which could lead to a lock up as the client would wait (until time out) for a server response that will never come. The solution is to also wait for close events while waiting for I/O from or to the server. Bug report and patch submitted by: Armin Schöffmann
| * Bug#33899: Deadlock in mysql_real_query with shared memory connectionsDavi Arnaut2009-03-261-7/+13
| | | | | | | | | | | | | | | | | | The problem is that the read and write methods of the shared memory transport (protocol) didn't react to asynchronous close events, which could lead to a lock up as the client would wait (until time out) for a server response that will never come. The solution is to also wait for close events while waiting for I/O from or to the server.
| * Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-1/+1
| | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | Fixed a lot of compiler warnings and errors detected by Forte C++ on Solarismonty@mysql.com/nosik.monty.fi2007-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map()
* | Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51tsmith@quadxeon.mysql.com2007-06-051-46/+49
|\ \ | | | | | | | | | into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
| * | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* | | Merge pilot.blaudden:/home/msvensson/mysql/bug26664/my50-bug26664msvensson@pilot.blaudden2007-05-241-15/+27
|\ \ \ | |/ / |/| / | |/ into pilot.blaudden:/home/msvensson/mysql/bug26664/my51-bug26664
| * Bug#26664 test suite times out on OS X 64bitmsvensson@pilot.blaudden2007-05-241-15/+27
| | | | | | | | | | | | | | | | | | | | | | - The "mysql client in mysqld"(which is used by replication and federated) should use alarms instead of setting socket timeout value if the rest of the server uses alarm. By always calling 'my_net_set_write_timeout' or 'my_net_set_read_timeout' when changing the timeout value(s), the selection whether to use alarms or timeouts will be handled by ifdef's in those two functions. - Move declaration of 'vio_timeout' into "vio_priv.h"
* | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ \ | |/ | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | Changed header to GPL version 2 only
| * Remove compiler warningsmonty@mysql.com/nosik.monty.fi2006-11-201-8/+8
| | | | | | | | | | | | | | (Mostly in DBUG_PRINT() and unused arguments) Fixed bug in query cache when used with traceing (--with-debug) Fixed memory leak in mysqldump Removed warnings from mysqltest scripts (replaced -- with #)
| * Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maintcmiller@zippy.cornsilk.net2006-10-131-7/+7
| |\ | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/bug14262/my50-bug14262
| | * The behavior of "%p" varies. We prefer "0x%lx".cmiller@zippy.cornsilk.net2006-10-031-7/+7
| | |
| * | Merge shellback.(none):/home/msvensson/mysql/work/my50-workmsvensson@shellback.(none)2006-09-151-1/+1
| |\ \ | | | | | | | | | | | | into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
| * \ \ Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0--windows-vio-uninitcmiller@zippy.cornsilk.net2006-09-131-2/+27
| |\ \ \ | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
* | \ \ \ Merge shellback.(none):/home/msvensson/mysql/work/my50-workmsvensson@shellback.(none)2006-09-151-1/+1
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | into shellback.(none):/home/msvensson/mysql/work/my51-work
| * | | | Use the enum/define SHUT_RDWR instead of heardcoded "2" to shutdownmsvensson@shellback.(none)2006-09-151-1/+1
| |/ / /
| * | | Merge maint2.mysql.com:/data/localhome/tsmith/bk/41tsmith@maint2.mysql.com2006-09-011-8/+22
| |\ \ \ | | |_|/ | |/| | | | | | into maint2.mysql.com:/data/localhome/tsmith/bk/50
* | | | Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0--windows-vio-uninitcmiller@zippy.cornsilk.net2006-09-131-2/+27
|\ \ \ \ | | |_|/ | |/| | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
| * | | Fix initialized memory. Count the number of failures in shm-closing cmiller@zippy.cornsilk.net2006-09-081-2/+27
| |/ / | | | | | | | | | functions and return it.
* | | Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maintcmiller@zippy.cornsilk.net2006-09-051-8/+22
|\ \ \ | | |/ | |/| | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
| * | BUG#9678: Client library hangs after network communication failurekroki/tomash@moonlight.intranet2006-08-141-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Socket timeouts in client library were used only on Windows. The solution is to use socket timeouts in client library on all systems were they are supported. No test case is provided because it is impossible to simulate network failure in current test suit.
* | | Merge from 5.0 to 5.1. Third part with fixes.jani@ua141d10.elisa.omakaista.fi2006-05-311-8/+15
| | |
* | | Final patch to remove the last of the OS2 support. brian@zim.(none)2006-04-151-9/+5
| |/ |/|
* | No longer leak file descriptors in mysql_close. Fixes Bug#15846.cmiller@calliope.local2006-03-171-8/+14
| |
* | Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmpjani@ua141d10.elisa.omakaista.fi2005-10-131-1/+8
|\ \ | |/ | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
| * Fix wait_timeout (and kill) handling on Mac OS X by cleaning up howjimw@mysql.com2005-10-111-1/+8
| | | | | | | | | | signal handlers are set up, the blocking flags for sockets are set, and which thread-related functions are used. (Bug #8731)
* | Merge moonbone.local:/work/12887-bug-4.1-mysqlevgen@moonbone.local2005-09-151-1/+1
|\ \ | |/ | | | | into moonbone.local:/work/12887-bug-5.0-mysql
| * Merge mysql.com:/home/jimw/my/mysql-4.1-12723jimw@mysql.com2005-09-151-1/+1
| |\ | | | | | | | | | into mysql.com:/home/jimw/my/mysql-4.1-clean
| | * Fix shared memory connection handling on Windows. (Bug #12723)jimw@mysql.com2005-08-311-1/+1
| | |
* | | Merge mysql.com:/home/jimw/my/mysql-4.1-cleanjimw@mysql.com2005-09-121-0/+9
|\ \ \ | |/ / | | | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean
| * | Fixes bug #5588. Additions after merge from 4.0.SergeyV@selena.2005-09-071-2/+2
| | |
| * | Merge selena.:H:/MYSQL/src/#05588-mysql-4.0SergeyV@selena.2005-09-071-0/+9
| |\ \ | | |/ | |/| | | | into selena.:H:/MYSQL/src/#05588-mysql-4.1
| | * Fixes bug #5588. vio_was_interrupted() function was added to detectSergeyV@selena.2005-08-301-0/+9
| | | | | | | | | | | | read timeout properly on win32.
* | | Merge mysql.com:/home/bkroot/mysql-4.1lars@mysql.com2005-07-131-2/+2
|\ \ \ | |/ / | | | | | | into mysql.com:/home/bk/mysql-5.0
| * | Fixed some vio code that was using ___WIN__ instead of __WIN__reggie@linux.site2005-07-121-2/+2
| | |
* | | Merge mysql.com:/home/jimw/my/mysql-4.1-cleanjimw@mysql.com2005-06-201-0/+1
|\ \ \ | |/ / | | | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean
| * | Fix Windows build warning and file missing from projects.jimw@mysql.com2005-06-081-0/+1
| | |
* | | Merge bk-internal.mysql.com:/users/rburnett/bug9721rburnett@bk-internal.mysql.com2005-05-061-3/+5
|\ \ \ | |/ / | | | | | | into bk-internal.mysql.com:/users/rburnett/mysql-5.0
| * | Bug #9721 net_write_timeout not used on Windows rburnett@bk-internal.mysql.com2005-05-061-6/+3
| | | | | | | | | | | | | | | viosocket.c: Use ?: syntax to simplify code for setting both timeouts
| * | Bug #9721 net_write_timeout not used on Windows rburnett@bk-internal.mysql.com2005-05-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added an extra parameter to all calls to timeout(). 1 means we want to set the write timeout 0 means we wnat to set the read timeout viossl.c: Add which parameter to ssl timeout routine vio_priv.h: Added which parameter to vio_ignore_timeout and vio_ssl_timeout violite.h: Add which parameter to vio_timeout sigs net_serv.cc: Use proper which code in call to vio_timeout to set the proper timeout viosocket.c: Set the appropriate timeout in vio_timeout
* | | Porting of "buffered read" patch to 5.0 and post-review fixes.konstantin@mysql.com2005-03-061-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | The patch implements the idea suggested by Olaf van der Spek in thread "Client: many small reads?" (internals@lists.mysql.com). Now small reads performed by the client library are buffered. The buffering gives up to 2 times speedup when retrieving one-column tables.
* | | Merge with 4.1monty@mysql.com2005-02-151-0/+12
|\ \ \ | |/ /
| * | Merge with 4.0monty@mysql.com2005-02-151-0/+12
| |\ \ | | |/
| | * Better bug fix for #5569: "Incorrect "Access Denied" error with SAME login ↵monty@mysql.com2005-02-151-0/+12
| | | | | | | | | | | | | | | | | | | | | DIFFERENT host" This fixes also the reverse lookup bug introduced by the previous patch
* | | 4.1 -> 5.0 mergemonty@mysql.com2005-02-031-1/+1
|\ \ \ | |/ /
| * | Merge fixes for #8248, #5569.jimw@mysql.com2005-02-021-1/+1
| |\ \ | | |/
| | * Always call vio_in_addr() so that thd->remote isjimw@mysql.com2005-01-251-1/+1
| | | | | | | | | | | | always initialized. (Bug #5569)