Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorArt Cancro <ajc@citadel.org>
Wed, 13 Oct 2010 22:35:36 +0000 (18:35 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 13 Oct 2010 22:35:36 +0000 (18:35 -0400)
citadel/citadel_urlshorteners.rc [new file with mode: 0644]
citadel/debian/rules
citadel/sysdep.c

diff --git a/citadel/citadel_urlshorteners.rc b/citadel/citadel_urlshorteners.rc
new file mode 100644 (file)
index 0000000..ce44f7b
--- /dev/null
@@ -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/
index b5fe2dd9e191b99d1ff641f2ba11772886515088..6779c8f512e592f4acd54e0959b1cb67ed3d1ded 100755 (executable)
@@ -31,6 +31,7 @@ endif
 
 ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
        THREAD_ARGS=--without-threaded-client
+       CFLAGS += -D WITH_THREADLOG
 else
        THREAD_ARGS=
 endif
index 09b66f286cecabb0f6c2ff4345340a1d303f19b4..2e43b66bb0c472ddfae6558e3e7661cb7b911e80 100644 (file)
@@ -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);
        }
 }