View Single Post
Old 06-27-2004, 08:18 PM   #4
 
Posts: n/a
Yes it wouldn't of course list the exact error.  That's not its purpose.  You did of course validate your configuration according to the article, as it do appear your cygwin setup is not correct.

Anyway whenever you do get that ironed out, the following patch for Dystopia to run threaded host lookups on cygwin might be helpful.

[code] $ diff -uw ../dystopia/src/comm.c comm.c
--- ../dystopia/src/comm.c      2002-04-27 10;36;18.000000000 -0400
+++ comm.c      2004-01-09 05;06;56.987027700 -0500
@@ -1012,16 +1012,27 @@
}
#endif

+#ifdef
+pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
void lookup_address(DUMMY_ARG *darg)
{
  struct hostent *from = 0;
+#ifndef
  struct hostent ent;
  char buf[16384]; // enough ??
  int err;
+#endif

  thread_count++;

+#ifdef
+  pthread_mutex_lock(&hostent_mutex);
+  from = gethostbyaddr( darg->buf, sizeof(darg->buf), AF_INET);
+#else
  gethostbyaddr_r( darg->buf, sizeof(darg->buf), AF_INET, &ent, buf, 16384, &from, &err);
+#endif

  if (from && from->h_name)
  {
@@ -1029,6 +1040,9 @@
    darg->d->host = str_dup(from->h_name);
  }

+#ifdef
+  pthread_mutex_unlock(&hostent_mutex);
+#endif
  /*
   * Brilliant system there Mr. Jobo
   */
[/quote]
  Reply With Quote