Message10151
Logged In: YES
user_id=43919
The XMLRPC request is clearly being logged as coming from my
cisco switch when it was, in fact, coming from localhost.
I can't find any clear documentation, but it seems that on
at least some systems gethostbyname and gethostbyaddr
reference the same static variable, so having separate locks
for each one (as seen in socketmodule.c) doesn't help
anything. It's not so much that they're not reentrant, but
you can't call any combination of the two of them at the
same time. Here's some test code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <assert.h>
int main(int argc, char **argv) {
struct hostent *byaddr, *byname;
unsigned int addr;
struct sockaddr *sa = (struct sockaddr *)&addr;
addr=1117120483;
byaddr=gethostbyaddr(sa, sizeof(addr), AF_INET);
assert(byaddr);
printf("byaddr: %s\n", byaddr->h_name);
byname=gethostbyname("mail.west.spy.net");
assert(byname);
printf("byname: %s\n", byname->h_name);
printf("\nReprinting:\n\n");
printf("byaddr: %s\n", byaddr->h_name);
printf("byname: %s\n", byname->h_name);
}
|
|
Date |
User |
Action |
Args |
2007-08-23 14:00:22 | admin | link | issue539175 messages |
2007-08-23 14:00:22 | admin | create | |
|