mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Applied patch from #135.
This commit is contained in:
parent
09c866221c
commit
c2e16b8901
|
@ -1,5 +1,7 @@
|
|||
2007-02-11 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/pqpath.c: ported psycopg1 patch from #135.
|
||||
|
||||
* psycopg/connection_type.c: now the password is obfuscated after we try
|
||||
to connect to the backend. This really fixes #147.
|
||||
|
||||
|
|
|
@ -716,20 +716,22 @@ _pq_copy_out(cursorObject *curs)
|
|||
PyObject *tmp = NULL;
|
||||
|
||||
char buffer[4096];
|
||||
int status, len;
|
||||
int status, len, ll=0;
|
||||
|
||||
while (1) {
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
status = PQgetline(curs->conn->pgconn, buffer, 4096);
|
||||
Py_END_ALLOW_THREADS;
|
||||
if (status == 0) {
|
||||
if (buffer[0] == '\\' && buffer[1] == '.') break;
|
||||
if (!ll && buffer[0] == '\\' && buffer[1] == '.') break;
|
||||
|
||||
len = strlen(buffer);
|
||||
buffer[len++] = '\n';
|
||||
ll = 0;
|
||||
}
|
||||
else if (status == 1) {
|
||||
len = 4096-1;
|
||||
ll = 1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user