~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/interfaces/libpq/fe-misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * Portions Copyright (c) 1994, Regents of the University of California
24
24
 *
25
25
 * IDENTIFICATION
26
 
 *        $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.138 2009/01/01 17:24:03 momjian Exp $
 
26
 *        $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.140 2009/06/11 14:49:14 momjian Exp $
27
27
 *
28
28
 *-------------------------------------------------------------------------
29
29
 */
178
178
int
179
179
pqGetnchar(char *s, size_t len, PGconn *conn)
180
180
{
181
 
        if (len < 0 || len > (size_t) (conn->inEnd - conn->inCursor))
 
181
        if (len > (size_t) (conn->inEnd - conn->inCursor))
182
182
                return EOF;
183
183
 
184
184
        memcpy(s, conn->inBuffer + conn->inCursor, len);
769
769
#ifndef WIN32
770
770
                sent = pqsecure_write(conn, ptr, len);
771
771
#else
 
772
 
772
773
                /*
773
 
                 * Windows can fail on large sends, per KB article Q201213. The failure-point
774
 
                 * appears to be different in different versions of Windows, but 64k should
775
 
                 * always be safe.
 
774
                 * Windows can fail on large sends, per KB article Q201213. The
 
775
                 * failure-point appears to be different in different versions of
 
776
                 * Windows, but 64k should always be safe.
776
777
                 */
777
778
                sent = pqsecure_write(conn, ptr, Min(len, 65536));
778
779
#endif
1073
1074
        FD_ZERO(&output_mask);
1074
1075
        FD_ZERO(&except_mask);
1075
1076
        if (forRead)
1076
 
                FD_SET(sock, &input_mask);
 
1077
                FD_SET          (sock, &input_mask);
 
1078
 
1077
1079
        if (forWrite)
1078
 
                FD_SET(sock, &output_mask);
1079
 
        FD_SET(sock, &except_mask);
 
1080
                FD_SET          (sock, &output_mask);
 
1081
        FD_SET          (sock, &except_mask);
1080
1082
 
1081
1083
        /* Compute appropriate timeout interval */
1082
1084
        if (end_time == ((time_t) -1))