]> git.evergreen-ils.org Git - OpenSRF.git/commit
Patch from Scott McKellar:
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 15 May 2008 13:36:32 +0000 (13:36 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 15 May 2008 13:36:32 +0000 (13:36 +0000)
commit3a5aa0275ab298a90be42647482de0477ba8c9a0
tree65a4af2913d5b3b601308ffeb2aa7204387ea8e4
parentf7660700a39c8089eafbd24081c37dedc5b37361
Patch from Scott McKellar:

This patch is mostly a performance tweak, but also tidies up a few
things.

In apacheParseParms() we load POST data and GET data into the same
buffer, with the GET data coming first.  However the old code loads
the POST data first.  If there is also some GET data, we juggle some
buffers in order to get the GET and POST data into the right order.

The new code loads the GET data first, and then appends the POST
data onto it.  Besides being simpler, the new code avoids a layer
of copying, as well as and two round trips through malloc() and
free().

Other details:

1. I rearranged the declarations of the variables sarray, buffer,
key, and val, so as to narrow their scope.  In the case of sarray
this rearrangement avoids a potential memory leak in the case of an
error exit (where the POST data is excessive).

2. I append a terminal null to the input buffer instead of using
memset() to fill the entire buffer.

3. Since the bread variable is a long rather than an int, I corrected
the format specifier accordingly in one of the debug messages.

4. I eliminated some redundant casts in a couple of calls to
ap_unescape(), since the variables so cast are already the right
types.

5. The final debug message was being issued only when sarray was
not NULL.  However at this spot sarray cannot be NULL anyway, so I
eliminated the test of sarray.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1320 9efc2488-bf62-4759-914b-345cdb29e865
src/gateway/apachetools.c