diff options
Diffstat (limited to 'psycopg/lobject_int.c')
-rw-r--r-- | psycopg/lobject_int.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/psycopg/lobject_int.c b/psycopg/lobject_int.c index cdca5d2..38c1273 100644 --- a/psycopg/lobject_int.c +++ b/psycopg/lobject_int.c @@ -201,12 +201,17 @@ lobject_write(lobjectObject *self, const char *buf, size_t len) PGresult *pgres = NULL; char *error = NULL; + Dprintf("lobject_writing: fd = %d, len = %d", + self->fd, len); + Py_BEGIN_ALLOW_THREADS; pthread_mutex_lock(&(self->conn->lock)); + PQsetnonblocking(self->conn->pgconn, 0); written = lo_write(self->conn->pgconn, self->fd, buf, len); if (written < 0) collect_error(self->conn, &error); + PQsetnonblocking(self->conn->pgconn, 1); pthread_mutex_unlock(&(self->conn->lock)); Py_END_ALLOW_THREADS; |