Skip to content

Commit fa6e31e

Browse files
committed
Do not use \x when serializing blobs
1 parent 6cba3f5 commit fa6e31e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/ngx_postgres_output.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,16 @@ ngx_postgres_output_hex(ngx_http_request_t *r, PGresult *res)
208208
char *value = PQgetvalue(res, 0, 0);
209209

210210
int start = 0;
211-
if (value[start] == '\\')
212-
start++;
213211
if (value[start] == 'x')
214212
start++;
215213

216-
fprintf(stdout, "GGOSGJKOSJGIJSDG [%d] [%d] [%.*s]\n", start, size, 10, value);
217-
218214
int i = 0;
219-
char *first = value[start];
220215
for (; start < size; start += 2)
221-
*b->last++ = hex2bin(value + start);
222-
//if (b->last != b->end) {
223-
// dd("returning NGX_ERROR");
224-
// return NGX_ERROR;
225-
//}
216+
*(b->last++) = hex2bin(value + start);
217+
if (b->last != b->end) {
218+
dd("returning NGX_ERROR");
219+
return NGX_ERROR;
220+
}
226221

227222
cl->next = NULL;
228223

0 commit comments

Comments
 (0)