Skip to content

Commit dd0c53a

Browse files
committed
Python: Do nxt_unit_sptr_get() earlier in nxt_python_field_value().
This is a preparatory patch for fixing an issue with the encoding of http header field values. This patch simply moves the nxt_unit_sptr_get() to the top of the function where we will need it in the next commit. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 0b85fe2 commit dd0c53a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/python/nxt_python_wsgi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ nxt_python_field_value(nxt_unit_field_t *f, int n, uint32_t vl)
863863
char *p, *src;
864864
PyObject *res;
865865

866+
src = nxt_unit_sptr_get(&f->value);
867+
866868
#if PY_MAJOR_VERSION == 3
867869
res = PyUnicode_New(vl, 255);
868870
#else
@@ -875,7 +877,6 @@ nxt_python_field_value(nxt_unit_field_t *f, int n, uint32_t vl)
875877

876878
p = PyString_AS_STRING(res);
877879

878-
src = nxt_unit_sptr_get(&f->value);
879880
p = nxt_cpymem(p, src, f->value_length);
880881

881882
for (i = 1; i < n; i++) {

0 commit comments

Comments
 (0)