Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
- Renamed tests and
Browse files Browse the repository at this point in the history
- Bumped version
- Added sending of COM_QUIT at connection close
- Added GIL lock/unlock for cpython I/O
  • Loading branch information
Jonas Tarnstrom committed Sep 2, 2011
1 parent 342d403 commit e4e00c5
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Connection.cpp
Expand Up @@ -200,8 +200,16 @@ bool Connection::close(void)
if (m_sockInst)
{
PRINTMARK();
m_capi.closeSocket(m_sockInst);

if (m_writer.isDone())
{
m_writer.reset();
m_writer.writeByte(MC_QUIT);
m_writer.finalize(0);
sendPacket();
}

m_capi.closeSocket(m_sockInst);
m_capi.deleteSocket(m_sockInst);
m_sockInst = NULL;
return true;
Expand Down
3 changes: 2 additions & 1 deletion io_cpython.c
Expand Up @@ -270,8 +270,9 @@ int API_wouldBlock(void *sock, int fd, int ops, int timeout)
FD_SET (fd, &writeSet);
break;
}

Py_BEGIN_ALLOW_THREADS
result = select (fd + 1, &readSet, &writeSet, NULL, &tv);
Py_END_ALLOW_THREADS

if (result < 1)
{
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -85,7 +85,7 @@
define_macros=[('WIN32_LEAN_AND_MEAN', None)])

setup (name = 'amysql',
version = '1.1',
version = '1.2',
description = 'Ultra fast MySQL driver for Python',
ext_modules = [module1],
author = "Jonas Tarnstrom",
Expand Down

0 comments on commit e4e00c5

Please sign in to comment.