From: Art Cancro Date: Wed, 13 Oct 2010 22:35:36 +0000 (-0400) Subject: Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel X-Git-Tag: v8.01~656^2~3 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=02f2cdebff8d3db11c6826a41b2770f5b65f1989;hp=3dc503b342d51ade8dd0fbad97e4b37c9d0f1a9f;p=citadel.git Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel --- diff --git a/citadel/citadel_urlshorteners.rc b/citadel/citadel_urlshorteners.rc new file mode 100644 index 000000000..ce44f7b7f --- /dev/null +++ b/citadel/citadel_urlshorteners.rc @@ -0,0 +1,16 @@ +# these URLs will be expanded when fetching them from +# RSS-Feeds with short contents (like twitter feeds) +# we expect to find a 30x location header, if we find it, +# we put it in front of that URL, so the full information +# whether one wants to click that or not can be expanded. +http://bit.ly/ +http://krz.ch/ +http://flic.kr/ +http://sns.ly/ +http://wp.me/ +http://ow.ly/ +http://tinyurl.com/ +http://goo.gl/ +http://dld.bz/ +http://tiny.cc/ +http://j.mp/ diff --git a/citadel/debian/rules b/citadel/debian/rules index b5fe2dd9e..6779c8f51 100755 --- a/citadel/debian/rules +++ b/citadel/debian/rules @@ -31,6 +31,7 @@ endif ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS))) THREAD_ARGS=--without-threaded-client + CFLAGS += -D WITH_THREADLOG else THREAD_ARGS= endif diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 09b66f286..2e43b66bb 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -118,10 +118,13 @@ void vCtdlLogPrintf(enum LogLevel loglevel, const char *format, va_list arg_ptr) struct timeval tv; struct tm tim; time_t unixtime; - CitContext *CCC = MyContext(); + CitContext *CCC = CC; ThreadTSD *cTSD = CTP; CtdlThreadNode *node = NULL; long lwpid = 0; + char formatbuf[SIZ]; + char LWP[64]; + char SESS[64]; if (cTSD != NULL) { node = cTSD->self; @@ -137,27 +140,30 @@ void vCtdlLogPrintf(enum LogLevel loglevel, const char *format, va_list arg_ptr) unixtime = tv.tv_sec; localtime_r(&unixtime, &tim); - fprintf(stderr, - "%04d/%02d/%02d %2d:%02d:%02d.%06ld ", - tim.tm_year + 1900, tim.tm_mon + 1, - tim.tm_mday, tim.tm_hour, tim.tm_min, - tim.tm_sec, (long)tv.tv_usec - ); - + *LWP = '\0'; if (lwpid != 0) { - fprintf(stderr, "[LWP:%ld] ", lwpid); + snprintf(LWP, 64, "[LWP:%ld] ", lwpid); } + *SESS = '\0'; if (CCC != NULL) { if (CCC->cs_pid != 0) { - fprintf(stderr, "[%3d] ", CCC->cs_pid); + snprintf(SESS, 64, " [%3d] ", CCC->cs_pid); } else if (CCC->user.usernum != 0) { - fprintf(stderr, "[:%ld] ", CCC->user.usernum); + snprintf(SESS, 64, " [:%ld] ", CCC->user.usernum); } } - vfprintf(stderr, format, arg_ptr); + snprintf(formatbuf, SIZ, + "%04d/%02d/%02d %2d:%02d:%02d.%06ld %s%s%s", + tim.tm_year + 1900, tim.tm_mon + 1, + tim.tm_mday, tim.tm_hour, tim.tm_min, + tim.tm_sec, (long)tv.tv_usec, + LWP, SESS, format + ); + + vfprintf(stderr, formatbuf, arg_ptr); fflush(stderr); } }