muck about
This commit is contained in:
parent
7e1a6cc8f5
commit
74ca4caca5
@ -581,7 +581,7 @@ func (self *NNTPDaemon) Run() {
|
|||||||
|
|
||||||
self.register_connection = make(chan *nntpConnection)
|
self.register_connection = make(chan *nntpConnection)
|
||||||
self.deregister_connection = make(chan *nntpConnection)
|
self.deregister_connection = make(chan *nntpConnection)
|
||||||
self.send_all_feeds = make(chan ArticleEntry)
|
self.send_all_feeds = make(chan ArticleEntry, 128)
|
||||||
self.activeConnections = make(map[string]*nntpConnection)
|
self.activeConnections = make(map[string]*nntpConnection)
|
||||||
self.loadedFeeds = make(map[string]*feedState)
|
self.loadedFeeds = make(map[string]*feedState)
|
||||||
self.register_feed = make(chan FeedConfig)
|
self.register_feed = make(chan FeedConfig)
|
||||||
@ -589,7 +589,7 @@ func (self *NNTPDaemon) Run() {
|
|||||||
self.get_feeds = make(chan chan []*feedStatus)
|
self.get_feeds = make(chan chan []*feedStatus)
|
||||||
self.get_feed = make(chan *feedStatusQuery)
|
self.get_feed = make(chan *feedStatusQuery)
|
||||||
self.modify_feed_policy = make(chan *modifyFeedPolicyEvent)
|
self.modify_feed_policy = make(chan *modifyFeedPolicyEvent)
|
||||||
self.ask_for_article = make(chan string)
|
self.ask_for_article = make(chan string, 128)
|
||||||
|
|
||||||
self.pump_ticker = time.NewTicker(time.Millisecond * 100)
|
self.pump_ticker = time.NewTicker(time.Millisecond * 100)
|
||||||
if self.conf.daemon["archive"] == "1" {
|
if self.conf.daemon["archive"] == "1" {
|
||||||
@ -917,7 +917,7 @@ func (self *NNTPDaemon) processMessage(msgid string) {
|
|||||||
// send to frontend
|
// send to frontend
|
||||||
if self.frontend != nil {
|
if self.frontend != nil {
|
||||||
if self.frontend.AllowNewsgroup(group) {
|
if self.frontend.AllowNewsgroup(group) {
|
||||||
go self.frontend.HandleNewPost(frontendPost{msgid, ref, group})
|
self.frontend.HandleNewPost(frontendPost{msgid, ref, group})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,10 +324,10 @@ func (self *httpFrontend) poll_liveui() {
|
|||||||
th := threads[c-idx-1]
|
th := threads[c-idx-1]
|
||||||
th.Update(self.daemon.database)
|
th.Update(self.daemon.database)
|
||||||
// send root post
|
// send root post
|
||||||
go live.Inform(th.OP())
|
live.Inform(th.OP())
|
||||||
// send replies
|
// send replies
|
||||||
for _, post := range th.Replies() {
|
for _, post := range th.Replies() {
|
||||||
go live.Inform(post)
|
live.Inform(post)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,7 +392,7 @@ func (self *httpFrontend) HandleNewPost(nntp frontendPost) {
|
|||||||
if len(ref) > 0 {
|
if len(ref) > 0 {
|
||||||
msgid = ref
|
msgid = ref
|
||||||
}
|
}
|
||||||
go func() {
|
|
||||||
entry := ArticleEntry{msgid, group}
|
entry := ArticleEntry{msgid, group}
|
||||||
// regnerate thread
|
// regnerate thread
|
||||||
self.Regen(entry)
|
self.Regen(entry)
|
||||||
@ -402,7 +402,7 @@ func (self *httpFrontend) HandleNewPost(nntp frontendPost) {
|
|||||||
}
|
}
|
||||||
// regen front page
|
// regen front page
|
||||||
self.RegenFrontPage()
|
self.RegenFrontPage()
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new captcha, return as json object
|
// create a new captcha, return as json object
|
||||||
@ -1098,6 +1098,7 @@ func (self *httpFrontend) handle_api_find(wr http.ResponseWriter, r *http.Reques
|
|||||||
} else {
|
} else {
|
||||||
self.daemon.database.SearchQuery(self.prefix, g, s, chnl)
|
self.daemon.database.SearchQuery(self.prefix, g, s, chnl)
|
||||||
}
|
}
|
||||||
|
chnl <- nil
|
||||||
<-donechnl
|
<-donechnl
|
||||||
close(donechnl)
|
close(donechnl)
|
||||||
io.WriteString(wr, " null ]")
|
io.WriteString(wr, " null ]")
|
||||||
@ -1541,9 +1542,9 @@ func NewHTTPFrontend(daemon *NNTPDaemon, cache CacheInterface, config map[string
|
|||||||
|
|
||||||
// liveui related members
|
// liveui related members
|
||||||
front.liveui_chnl = make(chan PostModel, 128)
|
front.liveui_chnl = make(chan PostModel, 128)
|
||||||
front.liveui_register = make(chan *liveChan)
|
front.liveui_register = make(chan *liveChan, 128)
|
||||||
front.liveui_deregister = make(chan *liveChan)
|
front.liveui_deregister = make(chan *liveChan, 128)
|
||||||
front.liveui_chans = make(map[string]*liveChan)
|
front.liveui_chans = make(map[string]*liveChan, 128)
|
||||||
front.end_liveui = make(chan bool)
|
front.end_liveui = make(chan bool)
|
||||||
return front
|
return front
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user