Author: adrian.chadd
Date: Mon Feb  2 10:38:37 2009
New Revision: 13780

Modified:
    branches/LUSCA_HEAD/src/access_log.c

Log:
strBuf() -> stringDupToC() and safe_free()

Its unfortunate, but in this particular bit of code the rfc1738* routines  
are called
which take a const char * as an argument.

The need to convert the strings to C strings in these (and other) instances  
will
suddenly go away once the rfc1738* routines are modified to take and return  
a String.



Modified: branches/LUSCA_HEAD/src/access_log.c
==============================================================================
--- branches/LUSCA_HEAD/src/access_log.c        (original)
+++ branches/LUSCA_HEAD/src/access_log.c        Mon Feb  2 10:38:37 2009
@@ -544,28 +544,32 @@
        case LFT_REQUEST_HEADER:
            if (al->request)
                sb = httpHeaderGetByName(&al->request->header, 
fmt->data.header.header);
-           out = strBuf(sb);
+           out = stringDupToC(&sb);
+           dofree = 1;
            quote = 1;
            break;

        case LFT_REPLY_HEADER:
            if (al->reply)
                sb = httpHeaderGetByName(&al->reply->header, 
fmt->data.header.header);
-           out = strBuf(sb);
+           out = stringDupToC(&sb);
+           dofree = 1;
            quote = 1;
            break;

        case LFT_REQUEST_HEADER_ELEM:
            if (al->request)
                sb = httpHeaderGetByNameListMember(&al->request->header,  
fmt->data.header.header, fmt->data.header.element,  
fmt->data.header.separator);
-           out = strBuf(sb);
+           out = stringDupToC(&sb);
+           dofree = 1;
            quote = 1;
            break;

        case LFT_REPLY_HEADER_ELEM:
            if (al->reply)
                sb = httpHeaderGetByNameListMember(&al->reply->header,  
fmt->data.header.header, fmt->data.header.element,  
fmt->data.header.separator);
-           out = strBuf(sb);
+           out = stringDupToC(&sb);
+           dofree = 1;
            quote = 1;
            break;

@@ -611,8 +615,10 @@
  #endif

        case LFT_USER_EXT:
-           if (al->request)
-               out = strBuf(al->request->extacl_log);
+           if (al->request) {
+               out = stringDupToC(&al->request->extacl_log);
+               dofree = 1;
+           }
            quote = 1;
            break;

@@ -660,7 +666,8 @@

        case LFT_REQUEST_URLPATH:
            if (al->request) {
-               out = strBuf(al->request->urlpath);
+               out = stringDupToC(&al->request->urlpath);
+               dofree = 1;
                quote = 1;
            }
            break;
@@ -695,8 +702,10 @@
            break;

        case LFT_EXT_LOG:
-           if (al->request)
-               out = strBuf(al->request->extacl_log);
+           if (al->request) {
+               out = stringDupToC(&al->request->extacl_log);
+               dofree = 1;
+           }

            quote = 1;
            break;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to