summaryrefslogtreecommitdiff
path: root/psycopg/cursor.h
diff options
context:
space:
mode:
authorJan UrbaƄski <wulczer@wulczer.org>2010-03-31 01:55:44 +0200
committerFederico Di Gregorio <fog@initd.org>2010-04-05 16:27:39 +0200
commit58eb868db6ef310a199abb45aea9fa8dd584cfc7 (patch)
treecb729a72c8773371948216d158397a754dbf90bf /psycopg/cursor.h
parent25a609c9a7379b758cd30f365e01d9601a67c37f (diff)
downloadpsycopg2-58eb868db6ef310a199abb45aea9fa8dd584cfc7.tar.gz
Avoid the possibility when curs_get_last_result would block
It was trying to get all pending results from the connection and if the client sent many and anyone except the first one would not be immediately available the loop in curs_get_last_result would call PQgetResult blockingly. Avoid that by calling PQisBusy every time and telling the client to wait for more data if it returns 1.
Diffstat (limited to 'psycopg/cursor.h')
-rw-r--r--psycopg/cursor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/cursor.h b/psycopg/cursor.h
index a2293a0..bbe80ea 100644
--- a/psycopg/cursor.h
+++ b/psycopg/cursor.h
@@ -86,7 +86,7 @@ typedef struct {
/* C-callable functions in cursor_int.c and cursor_ext.c */
HIDDEN void curs_reset(cursorObject *self);
-HIDDEN void curs_get_last_result(cursorObject *self);
+HIDDEN int curs_get_last_result(cursorObject *self);
HIDDEN PyObject *curs_poll_send(cursorObject *self);
HIDDEN PyObject *curs_poll_fetch(cursorObject *self);