r93300 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93299‎ | r93300 | r93301 >
Date:19:25, 27 July 2011
Author:asher
Status:deferred
Tags:
Comment:
added support to squid concurrency mode
Modified paths:
  • /trunk/debs/squid/redirector.c (modified) (history)

Diff [purge]

Index: trunk/debs/squid/redirector.c
@@ -19,16 +19,22 @@
2020 #define OVECCOUNT 30 /* should be a multiple of 3 */
2121
2222 struct IN_BUFF {
 23+ char *chan;
2324 char *url;
2425 };
2526
2627 int load_in_buff(char *buff, struct IN_BUFF *in_buff) {
27 - in_buff->url = strtok(buff, " ");
 28+ in_buff->chan = strtok(buff, " ");
 29+ in_buff->url = strtok(NULL, " ");
2830
29 - if(strlen(in_buff->url) <= 4) {
 31+ if(strlen(in_buff->chan) < 1) {
3032 return 1;
3133 }
3234
 35+ if(in_buff->url == NULL || strlen(in_buff->url) <= 4) {
 36+ return 1;
 37+ }
 38+
3339 return 0;
3440 }
3541
@@ -94,7 +100,7 @@
95101 if (rc < 0) {
96102 switch(rc) {
97103 case PCRE_ERROR_NOMATCH:
98 - printf("%s", in_buff.url);
 104+ printf("%s %s\n", in_buff.chan, in_buff.url);
99105 fflush(stdout);
100106
101107 break;
@@ -128,6 +134,7 @@
129135 }
130136
131137 if (strlen(path) > 0) {
 138+ printf("%s ", in_buff.chan);
132139 printf(replacement_url, lang, path);
133140 }
134141

Status & tagging log