@@ -133,30 +133,27 @@ pq_sendbytes(StringInfo buf, const void *data, int datalen)
133
133
* pq_sendcountedtext - append a counted text string (with character set conversion)
134
134
*
135
135
* The data sent to the frontend by this routine is a 4-byte count field
136
- * followed by the string. The count includes itself or not, as per the
137
- * countincludesself flag (pre-3.0 protocol requires it to include itself).
138
- * The passed text string need not be null-terminated, and the data sent
139
- * to the frontend isn't either.
136
+ * followed by the string. The count does not include itself, as required by
137
+ * protocol version 3.0. The passed text string need not be null-terminated,
138
+ * and the data sent to the frontend isn't either.
140
139
* --------------------------------
141
140
*/
142
141
void
143
- pq_sendcountedtext (StringInfo buf , const char * str , int slen ,
144
- bool countincludesself )
142
+ pq_sendcountedtext (StringInfo buf , const char * str , int slen )
145
143
{
146
- int extra = countincludesself ? 4 : 0 ;
147
144
char * p ;
148
145
149
146
p = pg_server_to_client (str , slen );
150
147
if (p != str ) /* actual conversion has been done? */
151
148
{
152
149
slen = strlen (p );
153
- pq_sendint32 (buf , slen + extra );
150
+ pq_sendint32 (buf , slen );
154
151
appendBinaryStringInfoNT (buf , p , slen );
155
152
pfree (p );
156
153
}
157
154
else
158
155
{
159
- pq_sendint32 (buf , slen + extra );
156
+ pq_sendint32 (buf , slen );
160
157
appendBinaryStringInfoNT (buf , str , slen );
161
158
}
162
159
}
0 commit comments