mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +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>
|
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
|
* psycopg/connection_type.c: now the password is obfuscated after we try
|
||||||
to connect to the backend. This really fixes #147.
|
to connect to the backend. This really fixes #147.
|
||||||
|
|
||||||
|
|
|
@ -716,20 +716,22 @@ _pq_copy_out(cursorObject *curs)
|
||||||
PyObject *tmp = NULL;
|
PyObject *tmp = NULL;
|
||||||
|
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
int status, len;
|
int status, len, ll=0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
Py_BEGIN_ALLOW_THREADS;
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
status = PQgetline(curs->conn->pgconn, buffer, 4096);
|
status = PQgetline(curs->conn->pgconn, buffer, 4096);
|
||||||
Py_END_ALLOW_THREADS;
|
Py_END_ALLOW_THREADS;
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (buffer[0] == '\\' && buffer[1] == '.') break;
|
if (!ll && buffer[0] == '\\' && buffer[1] == '.') break;
|
||||||
|
|
||||||
len = strlen(buffer);
|
len = strlen(buffer);
|
||||||
buffer[len++] = '\n';
|
buffer[len++] = '\n';
|
||||||
|
ll = 0;
|
||||||
}
|
}
|
||||||
else if (status == 1) {
|
else if (status == 1) {
|
||||||
len = 4096-1;
|
len = 4096-1;
|
||||||
|
ll = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user