Re: x-webobjects-request-id lacking uniqueness?
Re: x-webobjects-request-id lacking uniqueness?
- Subject: Re: x-webobjects-request-id lacking uniqueness?
- From: Patrick Middleton <email@hidden>
- Date: Tue, 7 Dec 2010 14:37:23 +0000
On 6 Dec 2010, at 15:27, Mark Ritchie wrote:
...
Patches welcome!
...
On 7 Dec 2010, at 11:30, Patrick Middleton wrote:
[3] adequate uniqueness could instead be created by ensuring that
when httpd forks, the child process resets uniqueID_str.
Here's a patch. The changes work for me with Apache 1.3.41. While I
was working against a fairly old source tree, I have verified that
the files of interest have not changed significantly compared to the
newest source tree at which I have been looking, which was shipped
with WebObjects 5.4.3. What this patch does not include is the
equivalent modification to the Apache 2.2 adaptor; it should be the
same one-line change in WebObjects_child_init() in Apache2.2/
mod_WebObjects.c as in in Apache/mod_WebObjects.c .
This email, including any attachments, is confidential and intended solely for the person or organisation to whom it is addressed. If you are not the intended recipient you must not disseminate, distribute or copy any part of this email nor take any action in reliance on it.
If you have received this in error please notify the sender immediately by email or phone +44 (0)1702 426400 and delete this email and any attachments from your system.
Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. If verification is required please request a hard-copy version.
OneStep Solutions LLP is registered in England and Wales under registration number OC337173 and has its registered office at 457 Southchurch Road, Southend-on-Sea, Essex SS1 2PH.
diff -crB Adaptors-mine/Adaptor/transaction.c Adaptors-std/Adaptor/transaction.c
*** Adaptors-mine/Adaptor/transaction.c Tue Dec 7 14:17:17 2010
--- Adaptors-std/Adaptor/transaction.c Tue Dec 7 14:22:28 2010
***************
*** 103,122 ****
return tr_lock == NULL;
}
- void transaction_init_again()
- {
- int currentTime = time(NULL);
- #ifndef WIN32
- int pid = getpid();
- #else
- int pid = GetCurrentProcessId();
- #endif
- WA_lock(tr_lock);
- sprintf(uniqueID_str, "%8.8x%8.8x", currentTime, pid);
- WA_unlock(tr_lock);
- }
-
-
#define haveTriedInstance(appreq, handle) (appreq->attemptedInstances[(handle)>>8] & (1<<((handle)&7)))
#define markTriedInstance(appreq, handle) (appreq->attemptedInstances[(handle)>>8] |= (1<<((handle)&7)))
/*
--- 103,108 ----
diff -crB Adaptors-mine/Adaptor/transaction.h Adaptors-std/Adaptor/transaction.h
*** Adaptors-mine/Adaptor/transaction.h Tue Dec 7 14:17:37 2010
--- Adaptors-std/Adaptor/transaction.h Tue Dec 7 14:22:28 2010
***************
*** 37,44 ****
/* Returns zero on success, nonzero if initialization fails. */
int transaction_init();
- void transaction_init_again();
-
/*
* Code common to all adaptors. The server-specific portion is responsible
* for collecting the request & related information. The URL must be
--- 37,42 ----
diff -crB Adaptors-mine/Apache/mod_WebObjects.c Adaptors-std/Apache/mod_WebObjects.c
*** Adaptors-mine/Apache/mod_WebObjects.c Tue Dec 7 14:24:27 2010
--- Adaptors-std/Apache/mod_WebObjects.c Tue Dec 7 14:22:28 2010
***************
*** 183,191 ****
* anything else?
* ac_readConfiguration(); force the configs to be checked
*/
-
- transaction_init_again();
-
return;
}
--- 183,188 ----
-- Patrick
This email, including any attachments, is confidential and intended solely for the person or organisation to whom it is addressed. If you are not the intended recipient you must not disseminate, distribute or copy any part of this email nor take any action in reliance on it.
If you have received this in error please notify the sender immediately by email or phone +44 (0)1702 426400 and delete this email and any attachments from your system.
Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. If verification is required please request a hard-copy version.
OneStep Solutions LLP is registered in England and Wales under registration number OC337173 and has its registered office at 457 Southchurch Road, Southend-on-Sea, Essex SS1 2PH.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden