@@ -133,30 +133,27 @@ pq_sendbytes(StringInfo buf, const void *data, int datalen)
133133 * pq_sendcountedtext - append a counted text string (with character set conversion)
134134 *
135135 * 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.
140139 * --------------------------------
141140 */
142141void
143- pq_sendcountedtext (StringInfo buf , const char * str , int slen ,
144- bool countincludesself )
142+ pq_sendcountedtext (StringInfo buf , const char * str , int slen )
145143{
146- int extra = countincludesself ? 4 : 0 ;
147144 char * p ;
148145
149146 p = pg_server_to_client (str , slen );
150147 if (p != str ) /* actual conversion has been done? */
151148 {
152149 slen = strlen (p );
153- pq_sendint32 (buf , slen + extra );
150+ pq_sendint32 (buf , slen );
154151 appendBinaryStringInfoNT (buf , p , slen );
155152 pfree (p );
156153 }
157154 else
158155 {
159- pq_sendint32 (buf , slen + extra );
156+ pq_sendint32 (buf , slen );
160157 appendBinaryStringInfoNT (buf , str , slen );
161158 }
162159}
0 commit comments