Bug 51398 - Code clean-up (various
Summary: Code clean-up (various
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: All (show other bugs)
Version: 2.5-HEAD
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2011-06-20 21:33 UTC by Christophe JAILLET
Modified: 2011-06-22 20:47 UTC (History)
0 users



Attachments
Proposed patch (5.11 KB, application/octet-stream)
2011-06-20 21:33 UTC, Christophe JAILLET
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe JAILLET 2011-06-20 21:33:09 UTC
Created attachment 27181 [details]
Proposed patch

Hi,

here is a patch that makes a few cleans up.

modified files are :

  - server/util.c : use apr_pstrmemdup instead of apr_pstrdup in order to avoid a call to strlen. Compute the length first and use it twice.

  - server/vhost.c : reorder code to do as above.
  - modules/proxy/proxy_util.c : same
  - modules/aaa/mod_authnz_ldap.c : more or less the same
  - modules/mappers/mod_rewrite.c : same
  - modules/dav/main/mod_dav.c : same
  - modules/dav/fs/repos.c : more or less the same

  - modules/proxy/mod_serf.c : use strcmp instead of strcasecmp when possible
                             : avoid a call to apr_pstrndup <-- PLEASE DOUBLE CHECK THIS ONE TO SEE IF THERE IS NO SIDE EFFECT

  - modules/cluster/mod_heartmonitor.c : use 'ap_rputs' instead of 'ap_rprintf'


Before apply the patch, please at least double check 'modules/proxy/mod_serf.c' to make sure that there is no side effect. The other ones should be ok as-is.

Hope this helps.
Comment 1 Stefan Fritsch 2011-06-22 20:47:24 UTC
committed as r1138627 with compile fixes to mod_heartmonitor.c and mod_serv.c