Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
eef5c4f0
Commit
eef5c4f0
authored
Apr 20, 2002
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pq_getstring doesn't go through pq_getbyte anymore, for better performance.
parent
32c6c99e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+24
-7
No files found.
src/backend/libpq/pqcomm.c
View file @
eef5c4f0
...
...
@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.c,v 1.13
0 2002/04/03 00:44:27 tgl
Exp $
* $Id: pqcomm.c,v 1.13
1 2002/04/20 23:35:43 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -569,20 +569,37 @@ pq_getbytes(char *s, size_t len)
int
pq_getstring
(
StringInfo
s
)
{
int
c
;
int
i
;
/* Reset string to empty */
s
->
len
=
0
;
s
->
data
[
0
]
=
'\0'
;
/* Read until we get the terminating '\0' */
while
((
c
=
pq_getbyte
())
!=
EOF
&&
c
!=
'\0'
)
appendStringInfoCharMacro
(
s
,
c
);
for
(;;)
{
while
(
PqRecvPointer
>=
PqRecvLength
)
{
if
(
pq_recvbuf
())
/* If nothing in buffer, then recv some */
return
EOF
;
/* Failed to recv data */
}
if
(
c
==
EOF
)
return
EOF
;
for
(
i
=
PqRecvPointer
;
i
<
PqRecvLength
;
i
++
)
if
(
PqRecvBuffer
[
i
]
==
'\0'
)
{
/* does not copy the \0 */
appendBinaryStringInfo
(
s
,
PqRecvBuffer
+
PqRecvPointer
,
i
-
PqRecvPointer
);
PqRecvPointer
+=
i
+
1
;
return
0
;
}
return
0
;
/* If we're here we haven't got the \0 in the buffer yet. */
appendBinaryStringInfo
(
s
,
PqRecvBuffer
+
PqRecvPointer
,
PqRecvLength
-
PqRecvPointer
);
PqRecvPointer
=
PqRecvLength
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment